changed range_selected_images.py to save each row of the image matrix successively