Enabled visualize command to work on devices.

- Improved version of #18 by @bencochran.
    - Removed _showLocalImage and merged _showImage and _showRemoteImage.
    - Added error message if attempt to get image data returns nil.
Simplified some expressions as suggested by @arigrant in #18.
Added errno import.