I believe the AppendPicture method solves this problem but I think I found the problem and the solution for the InsertPicture method as well:
Inspecting the xml files, I discovered that the relationship Id in the footer file doesn't match the Id in the footerx.xml.rels file, which results in a broken image.
I believe this happens because when the (Paragraph.)InsertPicture method encounters an index of 0, then the Id generated by the GetOrGenerateRel(p) method is not used.
Moving the following code down one bracket, so it's outside of the (first) else block, solves this problem:
// Extract the attribute id from the Pictures Xml.
XAttribute a_id =
from e in p_xml.Descendants()
select e.Attribute(XName.Get("embed", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"))
// Set its value to the Pictures relationships id.
Even though the AppendPicture method solves this problem, I thought it might be useful to share this (I only found out about AppendPicture after figuring this out anyway...)
Besides, I'm not entirely certain if this really is a bug, could be the code was placed there for a reason. (Which is also why I didn't immediately submit this as a patch, let me know if I should though.)