add media descriptors

http://manage.dimagi.com/default.asp?87176#783840

Don't merge until the questions raised in the case have been answered.
oh whoops, changed the the name of the variable to type_mapping and forgot to fix the indentation