the way I know how to do it is to place an image in a folder called "images" then reference the file via php script.
if (@file_exists("images/".($images["imageNumber"]).".jpg"))
{
$size = GetImageSize("images/".$image["imageNumber"].".jpg");
if($size[0]>0 && $size[1]>0)
echo "<td><img src=\"images/".$image["imageNumber"].".jpg\" border=0 ".$size[3]."></td>";
}
The database has a table called "images" with imageNumber fields that contain unique ImageNumbers.
The images must be named according to unique $imageNumber.