Add validation to call back functions
Merge pull request #1 from YvonneYu/master

Add validations of callbacks in saveDataStringAsImageDataToLibrary.