Fix bug swapping image width and height