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