How to stop Chrome from causing Download folder to reappear in gallery?
I know this doesn't answer your exact question. You'll save yourself a lot of time and effort going with another picture app such as QuickPic

It's fast and customizable, and you can select which folders to include OR exclude :)

Do yourself a favor and disable Gallery.