I had to solve the same issue recently.
What I've done is use a standard html <img> tag. Then, as the source, I have the address to a handler page.(e.g. http://localhost/mysite/myhandler.ashx?ImageID=1234
This handler then returns the object from the database
I use code (snippet) such as the below, to read the querystring
IsNothing(context.Request.QueryString("ImageID")) orelse IsNumeric(context.Request.QueryString("ImageID")) = false Then Exit Sub
ImageID = context.Request.QueryString("ImageID").ToString()
This assumes you read the data from the database, into an Object named "ImageObject"
ImageObject = cmd.ExecuteScalar() ' Query here is unimportant as you will use your own and return the single field for the image.
If IsNothing(ImageObject) = False AndAlso ImageObject.ToString <> "" Then
Hopefully this helps.