title: Firestore upload 2 images
body: <p>Hello I would like to upload 2 images as jpg, but I can't get the format correct, and it would only upload one picture.</p>
  <pre><code>
    const [badge, onBadgeChange] = useState('/');
    const [image, setImage] = useState('/');
  
  
    const addCompetition = async() =&gt;{
      await handleImageUpload()
     
  }
  
  
    const handleImageUpload = async() =&gt;{
      const imagebanner = ref(storage, 'images/'+ title+'banner'+ Timestamp.fromDate(new Date()) + &quot;.jpg&quot; )
      const imagebadge = ref(storage, 'images/'+ title+'badge'+ Timestamp.fromDate(new Date()) + &quot;.jpg&quot; )
      
      const blob = await new Promise((resolve, reject) =&gt; {
          const xhr = new XMLHttpRequest();
          xhr.onload = function () {
            resolve(xhr.response);
          };
          xhr.onerror = function (e) {
            console.log(e);
            reject(new TypeError(&quot;Network request failed&quot;));
          };
          xhr.responseType = &quot;blob&quot;;
          xhr.open(&quot;GET&quot;, image, true);
          xhr.send(null);
      });
  
  
  
  
  
        await uploadBytes(imagebanner, blob).then((snapshot) =&gt; {
          getDownloadURL(snapshot.ref).then((url) =&gt; {
              console.log(url)
              createCompetition({ title: title,
                description:description,
                venue:venue,
                age:age,
                gender:gender,
                rank:rank,
                date:date,
                dateCreated : Timestamp.fromDate(new Date()),
                maxplayers:maxplayers,
                hole:hole,
                badge:badge,
                image:image})
          })
          .catch((error) =&gt; console.log(error))
      })
      .catch((error) =&gt; console.log(error))
      // We're done with the blob, close and release it
      blob.close();
      navigation.pop();
      }
  
  
  
    
  
    const pickImage = async () =&gt; {
      // No permissions request is necessary for launching the image library
      let result = await ImagePicker.launchImageLibraryAsync({
        mediaTypes: ImagePicker.MediaTypeOptions.All,
        allowsEditing: true,
        aspect: [4, 3],
        quality: 1,
      });
  
      console.log(result);
  
      if (!result.cancelled) {
        setImage(result.uri);
      }
    };
  
    const pickImage2 = async () =&gt; {
      // No permissions request is necessary for launching the image library
      let result = await ImagePicker.launchImageLibraryAsync({
        mediaTypes: ImagePicker.MediaTypeOptions.All,
        allowsEditing: true,
        aspect: [4, 3],
        quality: 1,
      });
  
      console.log(result);
  
      if (!result.cancelled) {
        onBadgeChange(result.uri);
      }
    };
  </code></pre>
  <p>This code above works for one image but I can't get it to also upload  imagebadge, I am new to firebase so I have tried xhr.open(&quot;GET&quot;, {image, badge}, true) but that only made the one image that did upload to an octet image and not jpg anymore.</p>