<?php if(isset($imagens)){ ?>
<div id="galeria" class="row d-flex justify-content-center section-page slideInUp">
    <div class="col-md-12 col-lg-9">
        <div class="content-heading mb-30">
            <h2 class="m-0">Confira mais de perto</h2>                                                                
            <h3 class="c-title-dark">Fotos exclusivas* <small>Imagens meramente ilustrativas</small></h3>
        </div>
        <div class="row">
            <div class="col-md-12 p-0">
                <div class="galeria-unidades">
                    <div class="loading-img"><i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i></div>
                    <div class="show-imgs">
                        <div id="mygallery" >
                            <?php $count = 6; ?>
                            
                            <?php $i=1; foreach ($imagens as $img) { ?>
                            <?php if($i <= $count){ ?>
                            <a data-fancybox="images" href="<?php HImg::ref($img); ?>" class="<?php e($i==1 ? "first":"")?>">
                                <?php if(isset($imovel_header->status) && $imovel_header->status == 3){ ?>
                                <img alt="<?php e($title_page); ?> <?php HImg::alt($img); ?>" src="<?php HImg::ref($img); ?>">
                                <?php } else { ?>
                                <img alt="<?php HImg::alt($img); ?>" class="img-fluid" src="<?php HImg::ref($img); ?>">
                                <?php } ?>
                            </a>
                            <?php } ?>
                            <?php $i++; } ?>
                        </div>
                        <?php for($i = $count+1; $i<count($imagens);$i++) { ?>
                            <a data-fancybox="images" href="<?php HImg::ref($imagens[$i]); ?>" class="d-none"></a>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
        <a href="javascript:;" class="clickGallery">Ver mais fotos</a>
    </div>
</div>
<?php } ?>