How do I exclude portrait pictures from the nextgen gallery sidebar widget?

There are several things you could do to achieve what you want.

You could:

  • create a new gallery with just the landscape images and include this new gallery into the sidebar;
  • try different thumbnail settings in the NGG options (ignore aspect ratio or not, set height and width to the same value and thus show quadratic images);
  • edit the file widgets.php (which is located in wp-content\plugins\nextgen-gallery\widgets) in away that only landscape images are shown.

Two things regarding the latter case:

  1. You can check for landscape images with if ( $image->meta_data['width'] > $image->meta_data['height'] ). At a first glance, it seems you have to do your thing inside the foreach block starting in line 311.
  2. Unfortunately, each time you update NGG, your change will be overwritten. Since NGG does not allow custom templates for the widgets, you cannot just copy the file/folder into your theme directory. So keep a copy of the edit file widgets.php (somewhere outside the NGG folder).