resizing with orientation correction