better NS check in media_delete

as discussed in 22db8df7a2f043e38437a49bb327354b2a296bf0