Fix handling of first and last TOA reflectance images.