Foreach loop variable where accessed from async lambda expression, causing randomly image index assignment for a submodule.