Hello,
Please check and run the included examples of adding headers (https://www.phpdocx.com/api-documentation/layout-and-general/insert-headers-Word-document-with-PHP) and footers (https://www.phpdocx.com/api-documentation/layout-and-general/insert-footers-Word-document-with-PHP). Both methods are working perfectly.
You can find the same samples in the package. Also please check that the images have the correct extension for their mime-types (for example you are not adding a JPEG using a PNG extension file).
Please note that addHeader and addFooter methods can be used when creating a DOCX from scratch. If you are using a template you need to set placeholders in the template or import the headers/footers from an existing DOCX (https://www.phpdocx.com/api-documentation/layout-and-general/import-headers-and-footers-Word-document-with-PHP). If you need to mix both (templates and created from scratch) please use the mergeDocx method (https://www.phpdocx.com/api-documentation/docxutilities/merge-Word-documents-with-PHP, https://www.phpdocx.com/documentation/cookbook/headers-and-footers-for-sections).
Regards.