Fix wrong aspect ratio when resizing