Cleaning up the thumbnail update code to avoid unnecessary updates.