Replaced image struct by image class & tested read & write functions