<?php if ($image = $block->image()->toFile()): ?>
<figure>
    <img src="<?= $image->url() ?>" alt="<?= $block->alt()->or($image->alt()) ?>">
    <?php if ($block->caption()->isNotEmpty()): ?>
        <figcaption><?= $block->caption() ?></figcaption>
    <?php endif; ?>
</figure>
<?php endif; ?>
