Transformed image cache fix. Write all entries.
Outputstream Cleanup needs to handle sink close.

Change-Id: I88b49c63bd25eb5881b2ed578d30e22e724af36e