added check for number of channels in fetching pixel value. Addresses issue #147
Merge pull request #158 from salmanulhaq/issue-147

Added nchannel check. Fixes issue #147