implement encoded image cache