Fixed image cache cleanup bug