What i do actually, is that. I store the paths to the images in a config file, and the file name corresponding to a row of data in th DB. I think it is better trying not to store EVERYTHING in the DB, because, after a time, a table can contain 600.000 rows, and that's A LOT of them, when you try to do a complex SQL query. The server tends to hang up, but, if not that, queries run very slow (unless you have a great machine)
Personally, i do not store the binary data on the DB, especially if it is very large in size. You do it, fine, but just take a look at the script i gave you. It's much easier replacing it with
$file = "images/".$result;
$size = filesize($file);
fLIPIS