Issue ID #28 Refactored media JS