Various changes to allow image versions to be deleted. Note that
the version does not have to be the head version; any version can now be deleted. We mark the DB row as deleted and delete the image file when the purge option is given (which is most of the time).
Showing with 173 additions and 40 deletions