Main Image Won't Load Fully on Mobile Homepage

I’m getting ready to launch a site I’ve been working on over the last month and am having this small but frustrating issue. When loading the website for the first time on mobile (or exiting and then retyping in the address), the main image only loads about halfway. I can’t debug what’s going on because the second I try to debug, the image finishes loading. Is there a way to fix this through Kirby?

I’m currently loading in the image like so:

  <figcaption>
    <img id="main-img" src="<?= $page->cover()->toFile()->url() ?>">
      <span>
        <span class="example"><h1><?= $page->headline() ?></h1>
      </span>
   </figcaption>

I can’t reproduce an issue.

But your code is not failure safe (although that shouldn’t have an effect on the image loading).

<?php if ( $cover = $page->cover()->toFile() ) : ?>
  <figcaption>
    <img id="main-img" src="<?= $cover->url() ?>">
      <span>
        <span class="example"><h1><?= $page->headline() ?></h1>
      </span>
   </figcaption>
<?php endif ?>

Ah okay, that’s good to know. I think it was just the amount of images I had on the page. I optimized all of them further and am no longer having the issue!