headless PPTX to PDF mirrored background

I’m writing a tool in PHP where I use the LibreOffice headless in an exec() to convert a .pptx to .pdf.

exec('"C:\Program Files\LibreOffice 5\program\soffice.exe" --headless --convert-to pdf --outdir "path/to/outdir" "path/to/presentation.pptx"');

The file is created without issues, but I’ve noticed an error with certain background images.
A background image that is mirrored in the presentation is flipped back in the pdf. (it displays the source image, but ignores the orientation defined in the presentation)
These slides are displayed correctly in Impress.

The users of the tool (our client who is paying for it) will be uploading multiple presentations with over 200 slides each, they will not be able to doublecheck the previews one by one (the pdf is converted to preview images) and will expect our code to work out of the box.

A solution that comes to mind is having my code search for mirrored images in the xml of the presentation and then edit the images themselves. (I’ve done something similar to edit image types used by Powerpoint that aren’t recognized by Impress) But I’d rather have a solution that’s faster and less intrusive.

2 examples: (I’ve done some censoring, the presentation was provided by our client)

First thing when you find an issue is to test if it’s fixed with latest releases. Please use 6.0 or 6.1. You could use portable versions for that.

Upgrading to 6.0 solved the issue. Silly of me that I didn’t try the most recent version. Thanks again for your swift reply, this is the second time you’ve solved an issue with this project, I’ll be sure to mention your name in the backend somewhere.