Fixed a bug with media structure

Fixed a bug with missing directories
Unit test media types
Other minor bugs