private List<PhotoModel> convertMediaItemsToPhotoModels(
      UUID jobId,
      Optional<String> albumId,
      GoogleMediaItem[] mediaItems,
      TempMediaData tempMediaData) throws IOException {
    List<PhotoModel> photos = new ArrayList<>(mediaItems.length);
    ImmutableList.Builder<ErrorDetail> errors = ImmutableList.builder();

    for (GoogleMediaItem mediaItem : mediaItems) {
      try {
        PhotoModel photoModel = convertToPhotoModel(mediaItem, albumId, tempMediaData);
        photos.add(photoModel);

        monitor.debug(
            () -> String.format("%s: Google exporting photo: %s", jobId, photoModel.getDataId()));
      } catch (InvalidExportedItemException | ParseException e) {
        monitor.info(
            () ->
                String.format(
                    "%s: MediaItem (id: %s) failed to be converted to PhotoModel, and is being "
                        + "skipped: %s",
                    jobId, mediaItem.getId(),e));

        errors.add(GoogleErrorLogger.createErrorDetail(
            mediaItem.getId(), mediaItem.getFilename(), e, /* canSkip= */ true));
      }
    }

    // Log all the errors in 1 commit to DataStore
    GoogleErrorLogger.logFailedItemErrors(jobStore, jobId, errors.build());
    return photos;
  }
Method for storing a list of all photos that are already contained in albums
extensions/data-transfer/portability-data-transfer-google/src/main/java/org/datatransferproject/datatransfer/google/photos/GooglePhotosExporter.java