Fix JS to determine device pixel dimensions.