finished array_to_image