Image module: add read and write functions