<?php
$count = 1;

if ($this->images) {
    ?>
    <div class="slinky-gallery<?= $this->fx ?>">
        <?php
        foreach ($this->images as $image) {
            $thumbUrl = Images::getThumbUrl($image, 359, 286);
            if ($thumbUrl) {
                echo CHtml::image($thumbUrl, Images::getAlt($image));
                //echo $thumbUrl;
                $count++;
                if ($count > 5) {
                    break;
                }
            }
        }

        //echo $count;
        ?>
    </div>
<?php } ?>

