Display gallery of images

In addition to @bvdputte’s solution, you probably only want to show a gallery if the page has images:


<?php if ($page->hasImages()) : ?>

<div class="pic">
    <?php foreach($page->images() as $image): ?>
        <figure>
            <div class="box">
                <img src="<?= $image->url() ?>" alt="missing image">
            </div>

            <div class="inline">
                <span class="pic-tit">
                    <?= $image->Title() ?>
                </span>
                <span class="pic-siz">
                    <?= $image->WxH() ?>
                </span>
            </div>
        </figure>
    <?php endforeach ?>
</div>
<?php endif ?>

Consider using a figcaption element instead of the div inside your figure for semantic HTML: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure. You probably don’t need the div wrapper around your image.