function generate_image_size($image, $named_size, $params = NULL, $skip_defaults = FALSE)
 {
     $retval = $this->call_parent('generate_image_size', $image, $named_size, $params, $skip_defaults);
     // TODO: NGG should flush the displayed gallery cache after a user regenerates thumbnails
     // As of 2.0.78.5, it doesn't do this
     if (version_compare(NGG_PLUGIN_VERSION, '2.0.78.5', '<=')) {
         C_Photocrati_Cache::flush('displayed_gallery_rendering');
     }
     // TODO: This will generate a Retina-version of any other image created,
     // some of which don't need retina versions such as the IGW preview image
     // used in a post.
     //
     // We need to modify NGG so that parameters for dynamic images are stored in the database.
     // That way we could do a call like this:
     /*
     if ($retval) {
     	$params = $this->object->get_image_size_params($image, $named_size);
     	if (!isset($params['no_retina'])) $this->call_parent('generate_image_size', $image, M_NextGen_PictureFill::get_retina_named_size($image, $named_size));
     }
     */
     if ($retval) {
         $this->call_parent('generate_image_size', $image, M_NextGen_PictureFill::get_retina_named_size($image, $named_size));
     }
     return $retval;
 }
    ?>
"
               data-title="<?php 
    echo esc_attr($image->alttext);
    ?>
"
               data-description="<?php 
    echo esc_attr(stripslashes($image->description));
    ?>
"
               <?php 
    echo $effect_code;
    ?>
>
                <?php 
    M_NextGen_PictureFill::render_picture_element($image, $thumbnail_size_name, array('class' => 'nextgen_pro_film_image'));
    ?>
            </a>
            <?php 
    $this->end_element();
    ?>
        </div>
        <?php 
    $this->end_element();
    $i++;
}
$this->end_element();
if ($pagination) {
    echo $pagination;
} else {
    ?>
    ?>
"
                   data-title="<?php 
    echo esc_attr($image->alttext);
    ?>
"
                   data-description="<?php 
    echo esc_attr(stripslashes($image->description));
    ?>
"
                   <?php 
    echo $effect_code;
    ?>
>
	                <?php 
    M_NextGen_PictureFill::render_picture_element($image, $thumbnail_size_name);
    ?>
                </a>
            </div>
            <?php 
    $this->end_element();
    ?>
        <?php 
    $this->end_element();
    ?>
    <?php 
}
?>
    <?php 
$this->end_element();
?>
?>
">
	<?php 
$this->include_template('photocrati-nextgen_gallery_display#list/before');
?>
	<?php 
$i = 0;
foreach ($images as $image) {
    ?>
		<?php 
    $full_size_url = $storage->get_image_url($image);
    $full_size_2x_url = $storage->get_image_url($image, M_NextGen_PictureFill::get_retina_named_size($image, 'full'));
    $thumb_url = $storage->get_image_url($image, $thumbnail_size_name);
    $thumb_2x_url = $storage->get_image_url($image, M_NextGen_PictureFill::get_retina_named_size($image, $thumbnail_size_name));
    $thumb_size = $storage->get_image_dimensions($image, $thumbnail_size_name);
    $thumbnail_retina_size = M_NextGen_PictureFill::get_retina_named_size($image, $thumbnail_size_name);
    $template_params = array('index' => $i, 'class' => 'batch-image', 'image' => $image);
    $this->include_template('photocrati-nextgen_gallery_display#image/before', $template_params);
    ?>
         <img
             data-title="<?php 
    echo esc_attr($image->alttext);
    ?>
"
             data-alt="<?php 
    echo esc_attr($image->alttext);
    ?>
"
             data-src="<?php 
    echo esc_attr($full_size_url);
    ?>
"
               data-title="<?php 
    echo esc_attr($image->alttext);
    ?>
"
               data-description="<?php 
    echo esc_attr(stripslashes($image->description));
    ?>
"
               <?php 
    echo $effect_code;
    ?>
>
                <?php 
    // NOTE: we don't specify height as the "width" property might actually not reflect the final image width, because images are responsive and adapt to container size when needed
    M_NextGen_PictureFill::render_picture_element($image, $image_size_name, array('width' => $image_size['width'], 'height' => NULL));
    ?>
            </a>
            <?php 
    $this->end_element();
    ?>
            <?php 
    if (!empty($displayed_gallery->display_settings['display_captions']) && $displayed_gallery->display_settings['caption_location'] == 'below') {
        ?>
                <p class="ngg_pro_blog_gallery_caption_below"><?php 
        echo $image->description;
        ?>
</p>
            <?php 
    }
    ?>
        ?>
'
                    data-title="<?php 
        echo esc_attr($entity->title);
        ?>
"
                    data-description="<?php 
        echo esc_attr($entity->galdesc);
        ?>
"
                <?php 
    }
    ?>
                >
                <?php 
    M_NextGen_PictureFill::render_picture_element($entity->previewpic, $thumbnail_size_name, array('class' => 'gallery_preview'));
    ?>
            </a>
            <a href="<?php 
    echo esc_attr($entity->link);
    ?>
"
               title="<?php 
    echo esc_attr($entity->title);
    ?>
"
               class="caption_link" ><?php 
    echo_safe_html($entity->title);
    ?>
</a>
            <div class="image_description"><?php