Following is an example of image.php:
Now we can navigate through images with keyboard arrows.
However, you cannot reuse the same image in different posts since the parent link will direct you to the original post where that image appeared first.
This is explained in the Codex:
The default expected behavior for a gallery that has no explicit IDs stated is to add all images that have the post as post parent assigned. In other words, add all images that were uploaded using the “Add media” button/link on this post edit screen. Keep in mind that this as well means that every attachment added to that post later on will be interpreted to be part of the gallery. No matter if it was displayed as plain attachment or not.
I also noticed that while testing, a comic post would display all the panels uploaded at the same time, including those that weren’t part of a given post.
Now that could create confusion if you were to change your images or changed and re uploaded panels at a different date.
an attachment image is attached to its parent post and even has the parent post slug in its URL. This makes it tricky to really have the same attachment in more than one place.
— Samuel Wood (OTTO on WordPress)
Probably an edge case, but it is better to avoid re-using the same upload in different posts.