Accessing data from siblings

I’m came across the Kirby functions $pages->prev() and $pages->next() and thought I could use them to create a “previous article teaser” and “next article teaser” under a blog post.

Linking with<a href="<?= $prev->url() ?>"> is working, but accessing content like this$prev->picture()->toFile() to generate a preview isn’t working.

How can I use the prev() and next() pointer to get content from the page objects?

Thank You!

Check out the prevnext snippet in the Starterkit:

You can see it in action in each note page.