refactored MediaLibrary functionality into MediaDirectory