Adding an interface ImageOpenCloser

ImageOpenCloser will let us abstract the backend.