Hi there,
you could use a function like this:
<?php
if ( is_attachment() ) {?>
<div class-"attach-navigation">
<span class="prev"><?php previous_image_link( false, 'Previous Image' );?></span>
<span class="next"><?php next_image_link( false, 'Next Image' );?></span>
</div>
<?php
}
?>
And add it to a Hook element:
https://docs.generatepress.com/article/hooks-element-overview/
Use the after_content
hook, check execute PHP and set the display rules to entire site.
Then a little CSS to space out the links:
.attach-navigation {
display: flex;
justify-content: space-between;
}