added comment for array_to_image function