I'm using CMB2 to enable me to add custom images to a WordPress post via a File field type. Rather than have a user create a gallery and place it within the body of content, I wanted to control where and how it displayed.
<?php
// Tiled Photo Gallery
// - - - - - - - - - - - - - - - - - -
// Place outside of loop on single.php / page.php / or custom template where you want it to appear.
// I'm using this with CMB2 - https://github.com/WebDevStudios/CMB2, but it's not required.
// check for any image attachments to current post