Provide support for sorting ImageGallery by topic name.

Usecase: topic is retrieved via a search query which lists all users. Each user has a topic with his own name as topic name. Now we want to sort all images of the gallery by name of those users. So we want to use
the topic name as sorting criterion. This commit now enables this criterion.