added functionality wherethe color of each cell is determined from the uploaded image, and added to the object array