Split image into three arrays