fixed a bug that image#resize dosn't put an image at the last line
added test case for image#resize