   func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
     tableView.deselectRow(at: indexPath, animated: true)
     let controller = RestaurantDetailViewController.fromStoryboard()
-    controller.titleImageURL = randomImageURL()
+    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)

    starsView.rating = Int(restaurant.averageRating.rounded())
    priceLabel.text = priceString(from: restaurant.price)

    let imageURL = randomImageURL()
    thumbnailView.sd_setImage(with: imageURL)
  }

  override func prepareForReuse() {

  return priceText
}

private func imageURL(from string: String) -> URL {
  let number = (string.hashValue % 22) + 1
  let URLString =
      "https://storage.googleapis.com/firestorequickstarts.appspot.com/food_\(number).png"
  return URL(string: URLString)!
}

class RestaurantsTableViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
