fixed calculation of screen width and height for iOS 8