fixed the bug of different reading of image files for the 1st file and prev_ next_
fixed the bug of not reading capital extension files, on Mac, e.g. TIFF from Insight
added  get extension function for clarity