`pixel_ratio` -> `pixelRatio` as method name.

Also made the pixel ratio computation executed once, not every time an image is replaced (because it is not supposed to change within the lifecycle of a page).