Fixed mediaprovider to use the default media provider if the DB is master.