guarding against image source == NULL
Merge pull request #819 from n13/master

guarding against image source == NULL