The <ja:include> tag has a once attribute that causes the page to be included only once for the project. Useful, but for things like that, it's easier just to plant the code in init.bsh.
What's needed, instead, would be a tag that says, "include this page only once per directory." In other words, include this page when creating index.html, but don't call it again for index2.html, index3.html, and so on. At the next level down, however, it needs to be called for each folder, but again, only once for each.
jAlbum now recognizes a predir.bsh or predir.js file, which is executed once per directory. That takes care of this feature request (and a virtually identical one from six years ago that I'd forgotten about completely).