If you've created the preview image appropriately, then this computation shouldn't be necessary: the scale should always be 1.