Restructured firebase media storage to handle mediaIds with naughty characters, improved layout classes