<link href="/mbthemes/scripts/libs/jquery/lightbox/css/lightgallery.min.css" rel="stylesheet">
<script src="/mbthemes/scripts/libs/jquery/lightbox/js/lightgallery.min.js"></script>
<script src="/mbthemes/scripts/libs/jquery/lightbox/js/lg-fullscreen.min.js"></script>
<script src="/mbthemes/scripts/libs/jquery/lightbox/js/lg-thumbnail.min.js"></script>
<script src="/mbthemes/scripts/libs/jquery/lightbox/js/lg-pager.min.js"></script>
<script src="/mbthemes/scripts/libs/jquery/lightbox/js/lg-zoom.min.js"></script>
<script src="/mbthemes/scripts/libs/jquery/lightbox/js/lg-hash.min.js"></script>
{literal}
<script type="text/javascript">
    (function($) {
        $(this).lightGallery({
            dynamic: true,
            pager:true,
            dynamicEl: [
                {/literal}
        {foreach from=$previewFiles item=file name=foo}{literal}
                {
                "src": '{/literal}{$file}{literal}',
                'thumb': '{/literal}{$file}{literal}',
                'subHtml': '<h4>{/literal}{$item.name|escape}{literal}</h4>'
            },
        {/literal}{/foreach}{literal}
            ]
        })

   ;})(jQuery);;
</script>
{/literal}