What type of web gallery? In Lr Desktop, from the Web module? Or from "Lightroom on the Web" or lightroom.adobe.com, the browser-based element of Lightroom Mobile (subscription only)?
In the Web module, there is sometimes a limit of 500 photos. That's defined in the web gallery definition.
In Lightroom on the Web, there is no known limit.
In either case, I don't think you're hitting a limit on the number of images.
This is with LightRoom CC using a desktop PC
And last year I created a single web gallery of 540 images of the same annual event using Web Gallery with Bridge.
Lightroom and Bridge use completely different mechanisms for generating web galleries.
Try exporting using some other web gallery - maybe it's an issue with this specific gallery (you can give this one a try: http://fonto.pl/fontogallery.html)
Although it looks to me like some Lightroom memory (leak?) problem. Since you have 32GB or RAM there's not much you can do about it. Maybe try upgrading your Lightroom to the latest version which is Lightroom CC 2015.9 - so if that was a memory leak it could be fixed now.