Inside the skin1/modules/Detailed_Product_Images/product_images.tpl after the {section name=image loop=$images} code add:
Code:
<SCRIPT language=JavaScript1.2>
<!--
h = {$images[image].image_y} + 65;
w = {$images[image].image_x} + 85;
window.resizeTo(h,w);
-->
</SCRIPT>
May want to adjust the 65, 85 to whatever you like for spacing.
