automatic resizing decide for photos