I don't get the +1 part.  For a pure-white image wouldn't this return 254 as the min color?

It is also a little scary to have a loop that does not test the array length.  But I think I'm convinced that it is not needed here.