resize gallery thumbs to best fit