If i am not worng, the loop section should start after the <TR> tag to display the images horizontally.
Code:
{* $Id: product_images.tpl,v 1.12 2004/05/28 12:21:05 max Exp $ *}
{if $active_modules.Detailed_Product_Images ne ""}
{capture name=dialog}
<TABLE border="0" {if $productids ne ''}cellspacing="0" cellpadding="2"{else}cellspacing="1" cellpadding="2"{/if} cellspacing="0">
{if $productids ne ''}
{/if}
<TR class="TableHead">
</TR>
{if $images}
<TR{cycle values=", class='TableSubHead'"}>
{if $productids ne ''}{/if}
{section name=image loop=$images}
<TD align="center">
[img]{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}[/img]
{/section}
</TD>
</TR>
{if %image.last%}
{/if}
{else}
{/if}
</TR>
</TABLE>
{/capture}
{include file="dialog1.tpl" content=$smarty.capture.dialog extra="width=100%"}
{/if}