Randomize the hero background

I wish do the same thing described here.

The user add a few images from the panel using the visual select plugin Kirby-Selector: https://github.com/storypioneers/kirby-selector

But, I want show just one image from the selected and random, is possible?

For example:

<?php
$hero = $page->hero()->split();
foreach($hero as $heroImage) : ?>
<div class="hero" style="background-image: url(<?php echo $page->images()->find($heroImage)->url() ?>);">
<?php endforeach ?>

Thanks :slight_smile: