Missing HTML galley images after upgrade to 3.2.1.3

We recently migrated an OJS instance from a RedHat server to Ubuntu, and upgraded from 3.1 to 3.2 at the same time. All seems to be OK, except for one journal where they used HTML galleys in their archives.

We are experiencing something similar to Issue with embedded images in the HTML galleys in upgrading from OJS 2.4.8-1 or 3.1.2-4 to OJS 3.2.x - #10 by juanf.csic where the URLs are correct, but the images do not load in the browser. The suggested code changes are already available in the 3.2.1.3 version I upgraded to.

Additionally, there were some submission_files where the file_stage was still at 17 when it should have been 10, and the /submission/proof/ had “-17-” in the filename instead of “-10-”. When I update the file_stage in the database and change the filename for the images, the URL for the is displayed as OJS expects, but doesn’t load just like the other s.

As an example, go to https://openjournals.uwaterloo.ca/index.php/JoCI/article/view/2586/3227. There are three images in this HTML file.

The error messages in the /var/log/apache log when the page loads, because the images fail:

[Tue Aug 24 16:11:50.488611 2021] [proxy_fcgi:error] [pid 937] [client 40.77.202.129:50944] AH01071: Got error 'PHP message: ojs2: 404 Not Found\n', referer: https://openjournals.uwaterloo.ca/index.php/JoCI/article/download/3444/4520?inline=1
[Tue Aug 24 16:11:50.580627 2021] [proxy_fcgi:error] [pid 963] [client 40.77.202.129:50951] AH01071: Got error 'PHP message: ojs2: 404 Not Found\n', referer: https://openjournals.uwaterloo.ca/index.php/JoCI/article/download/3444/4520?inline=1
[Tue Aug 24 16:11:50.582679 2021] [proxy_fcgi:error] [pid 1566] [client 40.77.202.129:50950] AH01071: Got error 'PHP message: ojs2: 404 Not Found\n', referer: https://openjournals.uwaterloo.ca/index.php/JoCI/article/download/3444/4520?inline=1

Any suggestions are greatly appreciated!

Cheers,
Graham

Bumping this in case someone experienced something similar and can help!

Cheers,
Graham