add_frames: Ensure caches are sorted before zipping them