media_extract function

Extract media from a document object