swapping width and height for correct image dimensions