Do NULL-check on Image pointer when caching
Merge pull request #1017 from dorkster/fixes

Do NULL-check on Image pointer when caching