fix bug causing duplicate Media entries