Support 3-dimensional iterators in from_array

This change allows 3-dimensional iterators to be used in the first argument to `png.from_array`.

For example, previously to draw a 4x4 black and red chequered pattern using a list, you would have to do this:

    >>> a = [[0, 0, 0, 255, 0, 0], [255, 0, 0, 0, 0, 0]]
    >>> png.from_array(a, 'RGB').save('check.png')

With this change, if you wish, you are able to instead add a third dimension, separating the pixels in the rows like so:

    >>> a = [[[0, 0, 0], [255, 0, 0]], [[255, 0, 0], [0, 0, 0]]]
    >>> png.from_array(a, 'RGB').save('check.png')