fixed rounding issue, that may lead to an error because images scale over 1