refacoring gmagick.resize