It seems that Gallery mostly respects hidden (.foldername) folders and the .nomedia flag, but some process is alerting the Gallery to new folders and files as they are created, and that process does NOT respect hidden folders or .nomedia.
If you believe your problem is solved with the nomedia...