Fix critical bug when rebuilding IMG files

* Forgot Substream cannot expand like NonClosingStream could, so the IMG
files were size-locked.
* Satisfy the code analyzer for now. (I'd rather call Dispose() multiple
times than not at all.)