img.py: better sorting and formatting of !imglist