<?php if ($headerImage = $page->headerImage()): ?>
<img src="<?= $headerImage->toFile() ?>" alt="<?= $headerImage->caption() ?>">
<?php endif ?>
<?php if ($headerImage = $page->headerImage()): ?>
<img src="<?= $headerImage->toFile() ?>" alt="<?= $headerImage->caption() ?>">
<?php endif ?>