Added aspect ratio handling