added logic to test for null tika mediatypes