What happens if you disable cashing? Also, is cashing enabled on the site that is working OK?
I debugged javascript and compared the results from the working site with the one that is not working, surprisingly the results are the same. So this is not the problem.ed
I tried some interesting thing, I opened the page with the gallery's, cleared cache, and clicked on a gallery and it opened OK. After that it was stuck on that gallery. But after I cleared cache again, now I was able to return back.
So definitely it is a problem with caching. Because we are always on the same page, and Joomla caching system is just returning the previously loaded content. After cache expires, it gets new content, that is why sometimes it opens a gallery and can't get back.
Why it is working OK for logged users, you can find here :
http://docs.joomla.org/Cache
Only caches pages for guest visitors (not for logged in visitors)
P.S. Please delete : J51_Oxygen template. I added it to check if template is affecting this in some way, but I didn't realize that I cannot uninstall anything
