almost working image cache