add if statement to the featured image

instead of a lot of code you have 2 ways to achieve your goal

1-use timthumb

2- specifying height & width to your the_post_thumbnail()