since you say the images are in database (I takes this they are stored as a string in the database as oppose to on the filesystem) you must have a script that pulls it out and returns it. Double check that this script is setting the header correctly to what format of image it is.
You should see a line that looks similar to
PHP Code:
$im = imagecreatefromstring($data);
header('Content-Type: image/jpeg');
imagejpeg($im);
if that's what you you see, then make sure it's a jpeg you're trying to return
Unless you mean you just have the html stored in the database, then I'd check you html to see if it's linking to the right spot