add the click listener for the thumbnail