refactor imagecache