Allowing the same stream to both load an save an image