Rotated texture width/height messup

For rotated images the unpacking is working wrong, when image is 90 rotated, getSubimage is confusing width with height, as well as transform.translate was offsetting image to the right.