Sorting images.

tested sorting modes, seem to work correctly.
added code for getImages() to sort the files.