in the products table, create a column for the galeryID.
when creating a new product store the agalery ID.
you could create a select list and populate it with a recordset that returns the gallery names and IDs
on page where you display a galery, you would add code similar to tyhis:
<?php
$pg_id = '1';
$pg_theme = 'dark';
include('/Applications/MAMP/htdocs/pg_120/galleries/ribbon_fullsize/index.php');
?>
on the product display page, change the ID to use the gallery column from the recordset:
<?php
$pg_id = $row_recordsetName['GalleryColumn'];
$pg_theme = 'dark';
include('/Applications/MAMP/htdocs/pg_120/galleries/ribbon_fullsize/index.php');
?>