Modify thumbnail image display logic