handle caching images which are nil