edited image loop syntax