Add batching to attachCompanionFilesToImage (See #12485)
Merge pull request #2853 from joshmoore/12485-companion-loop

Add batching to attachCompanionFilesToImage (See #12485)