title: Incorrect images sometimes assigned to UIImageView in UITableViewCell
body: <p>I have a group chat with a few hundred people in it and when I scroll quickly, sometimes either user images jump from something to something else or incorrect images are shown for a user. </p>
  
  <p>I've followed a few other SO posts but I still seem to be doing something incorrectly. Anything stand out here and something that I can do to fix this issue?</p>
  
  <p>Thanks!</p>
  
  <pre><code>final class MessageCell: UITableViewCell {
  
      private lazy var profileImageView: UIImageView = {
          let imageView = UIImageView()
          imageView.layer.cornerRadius = 20
          imageView.clipsToBounds = true
  
          return imageView
      }()
  
      // MARK: – Init
  
      override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
          super.init(style: style, reuseIdentifier: reuseIdentifier)
  
          selectionStyle = .none
  
          addSubview(profileImageView)
  
          setupConstraints()
      }
  
      private func setupConstraints() {
          constrain(profileImageView) {
              let size: CGFloat = 36
              $0.width == size
              $0.height == size
              $0.bottom == $0.superview!.bottom - CGFloat(3)
              $0.left == $0.superview!.left + CGFloat(12)
          }
      }
  
  
      func configure(with presentable: CellPresentable) {
          self.presentable = presentable
  
          if let sender = presentable.sender, presentable.isFirstMessage {
              profileImageView.setImage(url: (sender.object(forKey: "picture") as? PFFile)?.url, fallbackText: presentable.username)
          } else {
              PFUser.query()?.whereKey("objectId", equalTo: presentable.message.senderUserId).getFirstObjectInBackground { [weak self] user, error in
                  self?.profileImageView.setImage(url: (user?.object(forKey: "picture") as? PFFile)?.url, fallbackText: presentable.username)
              }
          }
      }
  
      // MARK: Reuse -
  
      override func prepareForReuse() {
          super.prepareForReuse()
  
          profileImageView.kf.cancelDownloadTask()
          profileImageView.image = nil
      }
  
  }
  </code></pre>
  
  <p>In my View Controller:</p>
  
  <pre><code>let cell = tableView.dequeueReusableCell(withIdentifier: "MessageCell") as! MessageCell
  let presentable = CellPresentable(for: message, isFirstMessage: isFirstMessage, isLastMessage: isLastMessage)
  cell.configure(with: presentable)
  
  return cell
  </code></pre>