Upgrade to EhxVisited (sleazyfork.org/en/scripts/377945)
2.5 rolls back some changes from 2.4 and should work again.
It sounds a lot like the script was firing before the page was ready, thanks for reporting. Hopefully I can fix the issues 2.4 was addressing in another way.
Issue with the script starting
The script starts only sometimes for me and going from page to page will cause it to disappear. As well as sometimes going into a gallery then back to the index from within the gallery will cause it to load and highlight the visisted. In the console I am getting "I don't know what view mode this is!" in the console while sitting in Thumbnail mode, I flipped through all 4 modes just to check and that prior message appears every time for me. Currently this script is the only one I have running on the site.
Are there any steps I could do to produce a more indepth log to make this bug report better?
Edit: After reading another's post it appears something in going from 2.3 to 2.4 broke it. Downgrading to 2.3 and its functioning as expected