Generate thumbnails during saveAs

In order to not leave clients with NPEs,
when saveAs is called we also generate
the default 96 thumbnail.
Fix ThumbnailStore.thumbnailExists

thumbnailExists was broken and:
 1) throwing hibernate exceptions on save
 2) throwing NPEs during cache lookups

This should allow thumbnailExists to work
again. We may need a thumbnailExistsByLongestSide
method though.