You might want to check this for custom attachement page:
>
http://www.wpbeginner.com/wp-themes/...-in-wordpress/
just to point you in right direction (at least if you don't want to do it manually :D)
1. create post and add image gallery/image, make sure it links to attachement page and that using such page is set in your theme/settings (find it on net)
2. add custom field to that post with link : )
3. make custom attachement page and make it call parent post and query for value of custom field you've added... blink, insert in attachement page : )