formatting and image resizing