From what I see there, I’d expect that your problem is the meta value in story_detail_story_image is storing an image id.
Try replacing the following
<?php if ( get_post_meta( get_the_ID(), 'story_detail_story_image', true ) ) : ?>
<a href="https://wordpress.stackexchange.com/questions/177610/<?php the_permalink() ?>" rel="bookmark">
<img class="thumb" src="<?php echo get_post_meta( get_the_ID(), 'story_detail_story_image', true ); ?>" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
With the following
<?php
$image_id = get_post_meta( get_the_ID(), 'story_detail_story_image', true );
if ( ! is_int( $image_id ) ) {
echo "<p>Image ID not an integer. It is:</p><pre>"; var_dump( $image_id ); echo "</pre>";
} else if ( $image_id ) {
# The next line tries to grab an image with that id in thumbnail size
$image_data = wp_get_attachment_image_src( $image_id, 'thumbnail' );
if ( ! is_array( $image_data ) ) {
echo "<p>Image data not an array! It is:</p><pre>"; var_dump( $image_data ); echo "</pre>";
} else if ( is_array( $image_data ) ) {
# The next line grabs the url, which is stored in the first element of the array
$image_url = $image_data[0];
# the next three lines just grab post information
$post_id = get_the_ID();
$post_title = esc_attr( get_the_title() );
$post_link = get_permalink();
# The following displays the link. I just prefer heredoc syntax but you should be able to change it back if wanted
echo <<<HTML
<a href="https://wordpress.stackexchange.com/questions/177610/{$post_link}" rel="bookmark">
<img class="thumb" src="{$image_url}" alt="{$post_title}" />
</a>
HTML;
}
}
?>
That should grab the image id, use it to get the url, and then draw your link.
(revised to output what is wrong).