add condition to thumbnail layout