Only Display a block of code if post thumbnail is set
<?php if ( has_post_thumbnail() ) { ?> <div class="YOUR CLASS"> <?php echo get_the_post_thumbnail($post->ID,$size = 'YOURSIZE'); ?> </div> <?php } ?>