Attach (recommended) or Link to PDF file here:
[FormDB2_fr.pdf](https://github.com/mozilla/pdf.js/files/7352426/FormDB2_fr.pdf)

Configuration:
- Web browser and its version: Firefox nightly
- Operating system and its version: linux debian

Steps to reproduce the problem:
1. Open the pdf
2. The image on the top of each pages is missing 

What is the expected behavior? (add screenshot)
![image](https://user-images.githubusercontent.com/5641725/137465500-e8788893-f33d-4532-871d-43b464fa85f4.png)

What went wrong? (add screenshot)
![image](https://user-images.githubusercontent.com/5641725/137465363-f2b35fe4-6776-45e9-b9e4-ccef6d9ad670.png)

let marginH = 0;
    let marginV = 0;
    if (this.margin) {
      marginH = this.margin.leftInset + this.margin.rightInset;
      marginV = this.margin.topInset + this.margin.bottomInset;
    }
    let borderDims = null;
    if (this.w === "" || this.h === "") {
      let width = null;
      let height = null;
      let uiW = 0;
      let uiH = 0;
      if (this.ui.checkButton) {
        uiW = uiH = this.ui.checkButton.size;
      } else {
        const { w, h } = layoutNode(this, availableSpace);
        if (w !== null) {
          uiW = w;
          uiH = h;
        } else {
          uiH = getMetrics(this.font,  true).lineNoGap;
        }
      }
      borderDims = getBorderDims(this.ui[$getExtra]());
      uiW += borderDims.w;
      uiH += borderDims.h;
      if (this.caption) {
        const { w, h, isBroken } = this.caption[$getExtra](availableSpace);