Sort unique images properly
Sort unique images properly

Unfortunately, the $group aggregation does not maintain any order
with its output. However, we can sort the input before it goes in,
and then use $first in order to get $group to show what its first
entry was. We can then $sort by this in the output as well.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

OpenChemistry/mongochemserver