Image Picker gallery loads blank images

Hi, I’m having the following issue with the Image Picker plugin:

I get this in two cases:

  1. Every time I go back from the camera without taking any photo.

  2. When I delete an image from the device pictures path using :
    this.file.removeFile(copyFrom, name);
    where copyFrom = file:///storage/emulated/0/Pictures/
    and the name is retrieved from a date() function.

I think what happens is that ImagePicker saves a reference of the deleted file somewhere. I’m guessing that it’s saved in the app’s cache but after clearing it from device’s settings the blank spaces still persist.

This is my function to take photos using media-capture plugin:

  takePhoto() {
    this.mediaCapture.captureImage().then(
      (data: MediaFile[]) => {
        if (data.length > 0) {
          this.copyFileToLocalDir(data[0].fullPath);
        }
      },
      (err: CaptureError) => {
        console.error(err)
      }
    );
  }

And this is the imagePicker function to choose multiple elements from gallery:

  selectPhoto() {
    const options: ImagePickerOptions = {
      maximumImagesCount: 5,
      allow_video: true
    };
    this.imagePicker.getPictures(options).then(
      results => {
        for (var i = 0; i < results.length; i++) {
          this.copyFileToLocalDir(results[i]);
        }
      },
      (err: CaptureError) => console.error(err)
    );
  }