Updated image loop to not use an enumerator

*  We are not using the enumerator in the loop. So this has been rewritten to not use it.

Change-Id: I18cab2556190e8ce5c202c5f5e7b8e6b3dfe8f59