Dashboard scan queries

Fixes #747

The scan-related queries used to generate the dashboard charts and tasks were not grouping files by session. Many scan files can be part of a scan session, so it is more meaningful to give a count of the scan sessions, instead of a count of the files. This is also consistent with how the imaging browser groups scan files (by session).
This Query can be modified to be select Count (distinct s.ID).