Fix cache read in img compress.