CC-5450 : Refactor Media Management

working on creating a function to return a proper JSON nested array structure.