Issue #3153911 by alexpott, mrinalini9: Improve logic in metatag_page_attachments() and make code comments more clear.