Completed Anton's recent refactoring

Create Referral page was failing to show attachment thumbnail with an
exception.