for a 3 loop long for  it will not check the last img