Updated "getScreenshot" to consider the required viewport size along with the device pixel ratio, in order to decide whether an image scaling is necessary.