fixed a bug in image#resize