just added a function to provide fileoutputstream when saving ddsimage