added error logic for restful json call to get original image