Add validation to call back functions

I add validation for call back functions in saveDataStringAsImageDataToLibrary