Implemented the /media request handler