repect the rotation flag inside the image, rotate properly if needed