Added image resizing functionality.