swapped order of for() comparisons

 Thanks to this change, image[16] is never called  ( Same reasons as at line 3953 )