FIX: automatic readImage and writeImage