added pixel ratio detection