Add sorting options

The image list can now be sorted by name or modification date, in
ascending or descending order.
Don't use shared_ptr for ImageWorker::Task

A shared pointer was probably overkill, so instead rely on copying,
references, and move semantics.
Multiple fixes to scale_to_fit()

* Check that the image can fit with the scrollbar before returning 1.0.
* Store width and height internally as doubles instead of ints to
  increase precision.
* Check if resizing to fit with the scrollbar causes the height to
  shrink to less than 'dest_height'.

These should fix some issues with zoom-to-fit making images too small or
too big.