Nil checker for adding images to the cache. Should fix a crash
merging