Fix keyerror from mediagenerator