Added some functionality for resizing the image