Fix magic numbers in resize script

The magic numbers were hardcoded in the resize code.