adding conditionals to prevent duplicate thumbnails