For the same reasons as in T96944, the PageImagePersistenceHelper should be fixed so that it does not inappropriately set the namespace of a page to null.
https://gerrit.wikimedia.org/r/#/c/207727/ provides a general idea how to do this. However, do not change the column indices like I did in that patch, as it causes issues like T107727.