In displaying images dynamically, say, as part of a catalogue page, I find it easier to store images as jpeg files in a separate image directory. In the actual product database table, have a field called "image" and possibly have fields for "width" and height". In the following example I have each image stored in an images sub directory labeled the same as the product code for ease of use. Therefore I only need size attributes stored in the product database.
Access your database, extract data and format the code to display the table. Include as below where you want to place image.
<img src='images/$prod_code.jpg' width='$image_width' height='$image_height' alt='Image'>