Added compatibility with rails server JSON format and added pinging the rails server after image upload