added ability to save images from stream