Fixes invalidating image within cache when image is nil.
Renames and improves added test.
Merge pull request #42 from julianhirt/FixesResettingImageForKey

Fixes invalidating image within cache when image is nil.