I wrote a game that can download images from server and then store them inside Application.persistentDataPath.

My problem is when saving few images the scene hangs and when it is done saving, it executes the rest of the code.

How can I solve this issue?

Saving image into device local storage:

```
    if (File.Exists (Application.persistentDataPath + "/LayoutImages/")) {
        Debug.Log (imagesPathPrefix + " already exists.");
        return;
    }

    File.WriteAllBytes (Application.persistentDataPath + "/LayoutImages/abc.jpg", image);

```