IF statement to filter featured image article

If i understood you correctly, you want the featured image to be displayed or not based on whether it was uploaded or not. If so, the basic code is:

<?php
if( has_post_thumbnail() ) { ?>
<a href=<?php the_permalink(); ?>"><img src="https://wordpress.stackexchange.com/questions/231934/<?php the_post_thumbnail(); ?>" title="<?php the_title(); ?>" /></a>
<?php } ?>

And that displays the image linking to the post. From the code you provided it pretty much feels you want to include the image there:

<figure class="entry-image">
                            <a href="https://wordpress.stackexchange.com/questions/231934/<?php the_permalink(); ?>">
                                <?php 
                                if ( has_post_thumbnail() ) {
                                    the_post_thumbnail( $posts_image_size );
                                } elseif( first_post_image() ) { // Set the first image from the editor
                                    echo '<img src="' . first_post_image() . '" class="wp-post-image" />';
                                } ?>
                            </a>
</figure>

The thing is that in this form your code displays something whether the featured image is displayed or not so you basically need to wrap all of this code in if statement and get rid of it in the middle like so:

<?php
if( has_post_thumbnail() ) { ?>
 <figure class="entry-image">
      <a href=<?php the_permalink(); ?>"><img src="https://wordpress.stackexchange.com/questions/231934/<?php the_post_thumbnail(); ?>" title="<?php the_title(); ?>" /></a>
 </figure>
<?php } ?>

Now the statement checks whether your post has a featured image attached and then tries to display it with the whole class.
Let me know how that went for you and if I got what you meant.