major refactoring on adding media items