private void processResponse(ImageResponse response) {
    // First check if the response is for the right request. We may have:
    // 1. Sent a new request, thus super-ceding this one.
    // 2. Detached this view, in which case the response should be discarded.
    if (response.getRequest() == lastRequest) {
      lastRequest = null;
      Bitmap responseImage = response.getBitmap();
      Exception error = response.getError();
      if (error != null) {
        OnErrorListener listener = onErrorListener;
        if (listener != null) {
          listener.onError(
              new FacebookException(
                  "Error in downloading profile picture for profileId: " + getProfileId(), error));
        } else {
          Logger.log(LoggingBehavior.REQUESTS, Log.ERROR, TAG, error.toString());
        }
      } else if (responseImage != null) {
        setImageBitmap(responseImage);

        if (response.isCachedRedirect()) {
          sendImageRequest(false);
        }
      }
    }
  }