Display the first image of slideshow

Hi !

I’m using this plugin : [https://github.com/medienbaecker/kirby-images](http://kirby images) to create a gallery of images.
I want to display only the first image of this slideshow on Homepage. Actually I display all the image of the gallery with this line of code :

    <?php foreach($pages-> find('works')->children() as $preview): ?>
      <?php foreach($preview->slideshow()->yaml() as $image): ?>
        <?php if($image = $preview->image($image)): ?>
          <?= $image->html(); ?>
        <?php endif ?>
      <?php endforeach ?>
   <?php endforeach ?>

I had try to use limit(), but it doesn’t work…
I’ll continue to search on my side with a JS fuction, but I’m not sure is quite a good solution.
If you have any suggestion, I’ll be happy to read you.

Thanks a lot

if($image = $preview->image($preview->slideshow()->yaml()[0]) {
  // do stuff
}

(without the foreach loop, of. course)

I did that :

<?php foreach($pages-> find('works')->children() as $preview): ?>
    <?php if($image = $preview->image($preview->slideshow()->yaml()[0]) { echo $image->html(); }?>
<?php endforeach ?>

But I still have a Parse error.

I’m not yet good in php…

Sorry, there’s closing parenthesis missing

<?php if($image = $preview->image($preview->slideshow()->yaml()[0])) { echo $image->html(); }?>

Thanks, it was so simple.
Hard to see after a sprint work