You're welcome! Yes, the errors to watch out for are incorrect pairing. If I made a bad assumption about your filenames, you may get an incorrect result (though it should match the behavior I described, barring any bugs).
Fortunately, the code does not have to copy individual page elements. It...