adding image caching (along with rep cache)