Copy the resize function of imagick. See #19