Automatic bag detection and vacuum sealing