added basic image read/write