Deal with nonexistence of devicePixelRatio property in older browsers