image to array converter 2 - works on 3 dimensional array insead of 2 dimensional