User-520527587 posted
You can use URL rewriting
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
What you can do is make it so that all requests to this
www.mysite.com/imagehandler/anyimagename.jpg
redirects to this
www.mysite.com/imagehandler.ashx?image=anyimage.jpg
Then when you get it from the database and show it the address used to access it will be the name of the file.
Note: you will need to map the jpg extension or a wildcard to asp.net.
I hope that helps,
Brendan