Either there is a .nomedia file in the folder or there isn't.
What you may be seeing is that a picture may exist in more than 1 file (IOW, a duplicate), with one of them in a hidden folder and one in a non-hidden folder.
Remember - there's no "gallery" folder" - media scanner picks up all pictures in folders with no .nomedia file. If there's a duplicate, it may show the picture in "one folder", but it's really in another one too. So it's showing a couple of pictures in non-hidden folders that have duplicates in hidden folders.