1) the products table should store the image names in column, then on the details page set an image tag to use the column from the recordset:
<?img src="path/to/images/<?php echo $row_recordsetName['imageColumn'] ?>" />
2) how do you want product categories to work? Should a product be assigned to only one category? or can it be assigned to multiple categories?