{* Smarty template *}
{math assign=width equation='x + 20' x=$maxImageWidth}
{math assign=height equation='x + 30' x=$maxImageHeight}
<a href="javascript:openWindow('{buildUrl action='showImage' id=$commodityImageId absolute=true}', {$width}, {$height});">
<img src="image.php?id={$commodityImageId}&size=thumbnail&rnd={random}">
</a>