filter_image: encode after cache search