rewrite of SortThumbs for PBS
Merge pull request #649 from Gerk/pbsfix

rewrite of SortThumbs for PBS