Added option to keep aspect ratio