Handle html attachment preview on non existent docs

Some housekeeping to stop exceptions being raised when previewing HTML attachments on non-existent documents (https://errbit.production.alphagov.co.uk/apps/53020d6c0da11585f10000e7/problems/5386d40a0da11537fa000448). Also adds some extra checking to prevent the preview of HTML attachments on access-limited documents.