I believe it is an issue on Samsung's only, as they created their own gallery code. My Pixel 5 for instance does not have this issue because the native Google Photos system allows the user to decide what folders are and are not added to the native Android gallery database.