Working JS, not formatted

Media library page and all javascript involved is now working, page is
not yet formatted.