Newer IM4Ps have a SEQUENCE attached at the end. When creating an IMG4 the last INTEGER gets changed and makes the IMG4 invalid. This SEQUENCE seems to only be present on A11+ IM4Ps but I have only tested this on an A13 device and restoring this INTEGER from the original IM4P makes the image valid.
1158681:d=1 hl=2 l= 116 prim: OCTET STRING [HEX DUMP]:3072303702010104108B899A083A93F9788381A12B63CDD9BA04204983AD5134850A540BB81264F5DE41A764A0EACF84F0D857B6649800C49004A230370201020410F3B47B6767EBDCDA3E7B5363D80A5A6F0420E67E948423DE8E0294400FF6B5936E1BD6282ADD0F757A88D880450A7803D5AA. <---[KEYBAGS]
1158799:d=1 hl=2 l= 8 cons: SEQUENCE
1158801:d=2 hl=2 l= 1 prim: INTEGER :01
1158804:d=2 hl=2 l= 3 prim: INTEGER :177500 <---[This thing gets changed and it shouldn't]
Newer IM4Ps have a SEQUENCE attached at the end. When creating an IMG4 the last INTEGER gets changed and makes the IMG4 invalid. This SEQUENCE seems to only be present on A11+ IM4Ps but I have only tested this on an A13 device and restoring this INTEGER from the original IM4P makes the image valid.
1158681:d=1 hl=2 l= 116 prim: OCTET STRING [HEX DUMP]:3072303702010104108B899A083A93F9788381A12B63CDD9BA04204983AD5134850A540BB81264F5DE41A764A0EACF84F0D857B6649800C49004A230370201020410F3B47B6767EBDCDA3E7B5363D80A5A6F0420E67E948423DE8E0294400FF6B5936E1BD6282ADD0F757A88D880450A7803D5AA. <---[KEYBAGS]
1158799:d=1 hl=2 l= 8 cons: SEQUENCE
1158801:d=2 hl=2 l= 1 prim: INTEGER :01
1158804:d=2 hl=2 l= 3 prim: INTEGER :177500 <---[This thing gets changed and it shouldn't]