Added code for sanitizing file name when uploading.
Merged media controller.