Re-use existing CCImage when image data is set with filename already handled.

As part of the image caching also some code deduplication and simplification.
Use Filename of EnvironmentTextureNode and ImageTextureNode when it has been set.