 
     // Display data from Firestore, part two
 
-    let imageURL = randomImageURL()
-    thumbnailView.sd_setImage(with: imageURL)
+    let image = imageURL(from: restaurant.name)
+    thumbnailView.sd_setImage(with: image)
   }
 
   override func prepareForReuse() {

  return priceText
}

private func randomImageURL() -> URL {
  let randomImageNumber = Int(arc4random_uniform(22)) + 1
  let randomImageURLString =
  "https://storage.googleapis.com/firestorequickstarts.appspot.com/food_\(randomImageNumber).png"
  return URL(string: randomImageURLString)!
}

class RestaurantsTableViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    tableView.deselectRow(at: indexPath, animated: true)
    let controller = RestaurantDetailViewController.fromStoryboard()
    controller.titleImageURL = imageURL(from: restaurants[indexPath.row].name)
    controller.restaurant = restaurants[indexPath.row]
    controller.restaurantReference = documents[indexPath.row].reference
    self.navigationController?.pushViewController(controller, animated: true)
