Remove Front-End Dependency for ACF Gallery Field Example (displays images with src, alt, width/height and caption)
// Masonry Width Grids
$images = get_post_meta( get_the_ID(), 'masonry_image_grid', true );
// Check if acf/custom field data exists
if( $images ) { ?>
<ul class="grid effect-4" id="grid">
<?php foreach( $images as $image ) { ?>
<li>
<div class="masonry-block-wrap">
<?php echo wp_get_attachment_image( $image, 'full' );
if( !empty( get_post($image)->post_excerpt) ) { ?>
<div class="masonry-slide-overlay text-center">
<p>
<?php echo get_post($image)->post_excerpt; ?>
</p>
</div>
<?php
} ?>
</div>
</li>
<?php
} ?>
</ul>
<?php
}