Image module: add copy-to-buffer and map functions