Updated logic for sidebars.  If the db returns empty array, the sidebars show 'error' message.
Changed logic for sending invitation.  The invitation is now created from the same file that the preview is generated from.