Improve resource policy handler to make it work with all media resources