hmm, I don't know all too much about databases but what I would do is to not store the image into the database, but the file name of the image then just use a print("<image src=\"".$imagefile."\">");
but as I said, I don't really know much about databases so this is just a simple fix I suppose.