constructor(props) {
    super(props);

    if (props.source) {
      registerPendingPromise(
        new Promise((resolve, reject) => {
          this.resolve = (value) => {
            resolve(value);
            clearTimeout(this.timer);
          };
          this.timer = setTimeout(() => {
            const url = props.source.uri;
            const message = `Image "${url}" failed to load within ${IMAGE_LOAD_TIMEOUT}ms`;
            reject(new Error(message));
          }, IMAGE_LOAD_TIMEOUT);
        })
      );
    }
  }
This replaces the React Native Image component to register when it's finished
loading to avoid race conditions in visual tests.