Realized resizing canvas according original image size