Make sure that image link has correct file extension

The thumbnail extension doesn't necessary match the fullsize image.