Added support for saving images.