How to write two different downloadURL's to the same document (Firebase)

I am trying to upload two photos at the same time and write the download URL’s of both to the same firebase document. Instead what my code does is upload the photos and then writes two separate documents. What I am looking for is to write downloadUrl to PathImage and write the downloadUrl2 to PathImageSmall in the same document. What do I have to change so that it writes both of the download URL’s to the same document but in different fields?

import 'dart:async';
import 'dart:developer';
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:location/location.dart' as loco;
import 'package:path/path.dart' as path;
import 'MyService.dart';
import 'package:flutter_native_image/flutter_native_image.dart';

class ImagePickerHomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<ImagePickerHomePage> {
  FirebaseStorage storage = FirebaseStorage.instance;
  double? lat, lng;
  File? file;
  String? name, detail, pathImage, dateString;

  Future<XFile?> _upload(String inputSource) async {
    FirebaseAuth auth = FirebaseAuth.instance;
    User firebaseUser = auth.currentUser!;
    final picker = ImagePicker();
    try {
      final pickedImage = await picker.pickImage(
          source: inputSource == 'camera'
              ? ImageSource.camera
              : ImageSource.gallery,
              imageQuality: 100,
              maxHeight: 1080,
      );

      final String fileName = path.basename(pickedImage!.path);
            File imageFile = File(pickedImage.path);

      File pickedImage2 = await FlutterNativeImage.compressImage(pickedImage.path,
          quality: 10, percentage: 50);

      final String fileName2 = path.basename(pickedImage2.path);
            File imageFile2 = File(pickedImage2.path);

      try {
        final Reference storageReference = storage.ref(fileName);
        await storageReference.putFile(
            imageFile,
            SettableMetadata(customMetadata: {
              'uploaded_by': firebaseUser.displayName!,
              'description': 'Some description...'
            }));
        final String downloadUrl = await storageReference.getDownloadURL();
        await photoUploadFirestoreDetails(downloadUrl: downloadUrl, downloadUrl2: downloadUrl);
      } on FirebaseException catch (error) {}

      try {
        final Reference storageReference = storage.ref(fileName2);
        await storageReference.putFile(
            imageFile2,
            SettableMetadata(customMetadata: {
              'uploaded_by': firebaseUser.displayName!,
              'description': 'Some description...'
            }));
        final String downloadUrl2 = await storageReference.getDownloadURL();
        await photoUploadFirestoreDetails(downloadUrl: downloadUrl2, downloadUrl2: downloadUrl2);
      } on FirebaseException catch (error) {}
    } catch (err) {}
  }

 Future<void> findLatLng() async {
    loco.LocationData? locationData = await findLocation();
    setState(() {
      lat = locationData!.latitude;
      lng = locationData.longitude;
    });
  }

  Future<loco.LocationData?> findLocation() async {
    var location = loco.Location();
    try {
      return await location.getLocation();
    } catch (e) {
      return null;
    }
  }

  Future<void> photoUploadFirestoreDetails(
      {required String? downloadUrl, String? downloadUrl2}) async {
    FirebaseAuth auth = FirebaseAuth.instance;
    User firebaseUser = auth.currentUser!;
    Position _fetchedUserLocation = await Geolocator.getCurrentPosition(
        desiredAccuracy: LocationAccuracy.high);
    log(_fetchedUserLocation.latitude.toString() +
        _fetchedUserLocation.longitude.toString());
    final distanceInMiles1 = Geolocator.distanceBetween(_fetchedUserLocation.latitude,_fetchedUserLocation.longitude,45.48865,-122.46705);
    final distanceInMiles2 = Geolocator.distanceBetween(_fetchedUserLocation.latitude,_fetchedUserLocation.longitude,45.49076,-122.44689);

    List<dynamic> data = [
      {"mileage": 1, "geodistance": distanceInMiles1},
      {"mileage": 2, "geodistance": distanceInMiles2},
    ];


    String displayName = firebaseUser.displayName!;
    String dateString = DateFormat('hh:mm a - M-d').format(DateTime.now());
    double lat = _fetchedUserLocation.latitude.toDouble();
    double lng = _fetchedUserLocation.longitude.toDouble();
    String uid = firebaseUser.uid;
    final mileager = data.elementAt(0)["mileage"].toString();
    String dateLog = DateFormat('M-d kk:mm').format(DateTime.now());

    Map<String, dynamic> map = Map();
    map['DateTime'] = dateString;
    map['Racer'] = displayName;
    map['Lat'] = lat;
    map['Lng'] = lng;
    map['PathImage'] = downloadUrl;
    map['PathImageSmall'] = downloadUrl2;
    map['Uid'] = uid;
    map['mileager'] = mileager;
    map['location'] = GeoPoint(lat, lng);
    map['DateSortable'] = dateLog;

    FirebaseFirestore firestore = FirebaseFirestore.instance;
    CollectionReference collectionReference =
        firestore.collection('wllmtnnstpphotos');
    await collectionReference.doc().set(map).then((value) {
      routeToMap();
    });
  }

  void routeToMap() {
    MaterialPageRoute route =
        MaterialPageRoute(builder: (BuildContext buildContext) {
      return MyService();
    });
    Navigator.of(context).pushAndRemoveUntil(route, (Route<dynamic> route) {
      return false;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Photo Uploader'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(20),
        child: Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: [
                ElevatedButton.icon(
                    onPressed: () => _upload('camera'),
                    icon: Icon(Icons.camera),
                    label: Text('Camera')),
                ElevatedButton.icon(
                    onPressed: () => _upload('gallery'),
                    icon: Icon(Icons.library_add),
                    label: Text('Gallery')),
              ],
            ),
          ],
        ),
      ),
    );
  }
}