Work-around for a re-entrancy issue in the image cache.