Implement method for resizing image