Так у вас в коде repeater, а в самих полях gallery - это тип "Галерея", а не рипитер. У него чуть другой формат вывода:
<?php
// check if the flexible content field has rows of data
if ( have_rows( 'content' ) ) :
// loop through the rows of flexible content field data
while ( have_rows( 'content' ) ) : the_row();
// check current row layout for gallery
if ( get_row_layout() == 'gallery' ) : ?>
<h1><?php the_sub_field( 'title' ); ?></h1>
<p><?php the_sub_field( 'description' ); ?></p>
// get all images in gallery
// note the get_SUB_field function - it's a SUB field of flexible content
$images = get_sub_field( 'gallery' );
// if there are some images, build output
if ( $images ) : ?>
<ul>
<?php
// Loop through all images and output them
foreach( $images as $image ): ?>
<li>
<a href="<?php echo $image['url']; ?>">
<img
src="<?php echo $image['sizes']['thumbnail']; ?>"
alt="<?php echo $image['alt']; ?>"
/>
</a>
<p><?php echo $image['caption']; ?></p>
</li>
<?php endforeach; // end images loop ?>
</ul>
<?php endif; // end images output
endif;
endwhile; // end flexible content field loop
else :
// no layouts found
endif; ?>