Strange null returned form async function

I’m trying to get the URL of an uploaded image file on firebase storage, but I’m facing a very strange behavior.

Please take a look at the code below, problem is explained in the comented lines:

Future<String?> _uploadImage(String fileName, File imageFile) async {
    try {
      // Uploading the selected image with some custom meta data
      await FirebaseStorage.instance
          .ref(fileName)
          .putFile(
              imageFile,
              SettableMetadata(customMetadata: {
                'uploaded_by': 'Some guy',
                'description': 'Some description...'
              }))
          .then((imgUploadTaskSnapshot) async {
        switch (imgUploadTaskSnapshot.state) {
              case TaskState.paused:
                break;
              case TaskState.running:
                break;
              case TaskState.success:
                return await FirebaseStorage.instance.ref(fileName).getDownloadURL().then((fileURL) {
                  print('url : $fileURL'); // here i get a value -> url : https://firebasest.....
                  return fileURL; // but here null is returned
                });
                break;
              case TaskState.canceled:
                break;
              case TaskState.error:
                break;
            }
      });
    } on FirebaseException catch (error) {
      //Todo: handle errors
      print(error);
      throw error;
    }
}

Future<List<String>?> uploadImages(List<Map<String, dynamic>> images) async {
    try {
      List<String> imgsURLs = <String>[];
      for (int i = 0; i < images.length; i++) {
        await _uploadImage(images[i]['filename'], images[i]['imagefile'])
            .then((imgURL) {
          print('imgURL: $imgURL'); // cause here i get -> imgURL: null
          if (imgURL != null) {
            imgsURLs.add(imgURL);
          }
        });
      }
      print('imgsURLs: $imgsURLs');
      return imgsURLs;
    } on FirebaseException catch (error) {
      //Todo: hadle errors
      print(error);
      throw error;
    }
}