Hi,
Thanks Gruz for the code, works like a charm.
Regarding the request to make the main image link to display the image gallery, I replaced the caller code from:
<?php //echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', true,'rel="shadowbox"',true,true); ?>
to
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"',true,'class="gallery" rel="'.$this->product->virtuemart_product_id.'"',true,true); ?>
That displays the full image, but replaces the full image link with the gallery link.