Use screen object for screen dimension

Improves browser compatibility