corrected a bug in image#resize