Fix device resolution and flipped screen