Yes this is possible but is not recommended. You need to use a .htaccess file to route all data sent to urls which are image slugs to a page that reads the database, looks up the filename for the corresponding slug and then redirects to that image.
A better way would be to rename the file when the user uploads the file to the slug. When the user goes to the slug, you can then use .htaccess to capture the slug and use the slug as the filename as no database lookup is required.
Once you have renamed the file such that it is located at http://domain.com/images/slug.jpg
, you need to include the following in your .htaccess:
RewriteRule ^(.*)$ /images/$1.jpg [L]
However, the problem you will have is that there will likely be many urls of the form http://domain.com/anything/
which you do not want to map to an image. Therefore, it would be better to do the following:
RewriteRule ^image/(.*)$ /images/$1.jpg [L]
This will force uses to go to http://domain.com/image/slug
instead of http://domain.com/slug
but will avoid the above problem. Alternatively, you will have to create specific rules for any conflict you wish to avoid.