resize image for layout_sample