Sorts images by aspect ratio, optionally using a rules file for folder names