add SOI and EOI as well as using the actual image data for the segments