Implement attach/detach for image reader and writer. Bug: 19872821 Change-Id: Ib45a054c6be0b56b370fa8d709b47b0298ba5ea7