photo json downloading with error handling