Restructuring of image handling done, but streaming the data to a byte
array for writing is next to be done