need to create an Image class that would sotre the istream and its length. The length can be obtained in StoreBuffer method of DataCallback class