Minor Fixes

Minor fixes to main script to support images that may not be RGB.