Fix thumbnail switching issue.