bugfix - parsing media references correctly