Improvement to code to deal with missing contentMetadata metadata