'ACF Flexible Content - Image only displaying its link and not the designated thumbnail-sized image

I am trying to create my own Wordpress theme with assistance of Advanced Custom Fields. I have run into an issue that I cannot find the answer for.

I am trying to create a loop of images and text where the image is a thumbnail that when clicked shows full size through the usage of magnific popup. I can get the images to display statically without the lightbox effect but not with it. From the following code it only produces the link:

<?php

if( have_rows('content') ):
    while ( have_rows('content') ) : the_row(); ?>

<div class="loopcontainer">
    <?php if( get_row_layout() == 'text_with_image' ): ?>

        <?php 
            $images = the_sub_field('text_image');
                if( !empty( $images ) ): ?>
                    <a class="post-img" href="<?php echo $images['sizes']['blog-large'];?>">
                        <img src="<?php echo $images['sizes']['blog-small'];?>" class="img-fluid img-thumbnail">
                    </a>
        <?php endif; ?>
        
        <?php endif;

    endwhile;

else :
endif; ?>

How would I go around getting the lightbox effect to work within this Flexible Content solution? And where am I going wrong?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source