Media fix

Same as #859 but in the good branch.