	<ul>
{assign var='g_prevdepth' value=1}
{foreach from=$images item=image name=img}

{if $image->depth > $g_prevdepth}
{repeat string="<ul>" times=$image->depth-$g_prevdepth}
{elseif $image->depth < $g_prevdepth}
{repeat string="</li></ul>" times=$g_prevdepth-$image->depth}
</li>
{elseif $smarty.foreach.img.index > 0}</li>
{/if}
		<li><a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a> {$image->titlename}

{assign var='g_prevdepth' value=$image->depth}
{/foreach}
{repeat string="</li></ul>" times=$image->depth-1}</li>
	</ul>
{*----------{*----------*}