Only call graphics handler when there is graphical output to process
Merge pull request #43 from takluyver/graphics-handler-notnull

Only call graphics handler when there is graphical output to process