I have added an image size with code
add_image_size( 'medium_post_thumbnails', 87, 63, true);
By default WordPress has full/original image size.
I have a function where I use above image size 'medium_post_thumbnails', but I also have old posts where the image has original size.
echo '<div class="medium-news border-bottom margin-top">' .'<a href="'.get_permalink($post->ID). '">'; echo get_the_post_thumbnail($post->ID, 'medium_post_thumbnails', array('class' => 'img-fluid')). '</a></div>';
What I want to do here is if the 'medium_post_thumbnails' image size is not present, the function should use 'full' image.