graphic: update GetScaleRectInImage(), return error if argument is invalid