#set($count = 0)
#set($viewerlink = $content.get("assetviewerlink") )
#set($stackedfield = $mediaarchive.getCatalogSettingValue("stackedgalleryfield"))
#foreach( $brick in $loop.getPageOfHits())
#ifnotnull( $hitassetlookup )
#set( $hit = $hitassetlookup.get($brick.getId()) )
#end
#ifnull( $hitassetlookup )
#set( $hit = $brick)
#end
$context.putPageValue("brick", $brick)
$context.putPageValue("hit", $hit)
$context.putPageValue("asset", $hit)
#set($type = $hit.getSearchHit().getType())
$context.putPageValue("type", $type)
#set($rendertype = $mediaarchive.getMediaRenderType($hit.fileformat))
$context.putPageValue("rendertype", $rendertype)
#set($sourcepath = $hit.sourcepath)
$context.putPageValue("sourcepath", $hit.sourcepath )
$context.putPageValue("assetid", $hit.id)
$context.putPageValue("count", $count )
$context.putPageValue("thumbsize", "mediumplus" )
#set($assetwidth = $mediaarchive.getRealImageWidth($hit))
$context.putPageValue("assetwidth", "assetwidth" )
#set($assetheight = $mediaarchive.getRealImageHeight($hit))
$context.putPageValue("assetheight", "assetheight" )
#set($click = "$siteroot$viewerlink?hitssessionid=${hits.getSessionId()}&assetid=${hit.id}")
$context.putPageValue("click", "click" )
$pages.include("${searchhome}/thumbnails/brick.html", $context)
#set ( $count = $count + 1)
#end
#if ( $loop.getPageOfHits().size() == 0 )
$pages.stream("$!{searchhome}/empty.html", $context)
#end