changed checkThumbnail function