# Cloning images returns blanks

**URL:** <https://community.thunkable.com/t/cloning-images-returns-blanks/1042304>\
**Category:** Questions about Thunkable X\
**Created:** [January 7, 2021, 2:56am UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304 "2021-01-07T02:56:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingamaree](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@ingamaree](https://community.thunkable.com/u/ingamaree)\
**Post date:** [January 7, 2021, 2:56am UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/1 "2021-01-07T02:56:34Z")

</div>

Hi All!  
I have a problem and have had no luck searching for the answer.

In my app I am simply cloning an image 29 times.  
Each clone gets an image randomly from a list of 6 images.  
For some reason I end up with blank clones. Each time I load the screen the blanks are in different positions. The number of blank clones also varies.  
I have tried using a list, a Local DB and local storage data source and the result is the same.  
I thought maybe the blank is from the blank row that you get at the bottom of your DB. So I tried limiting the random images to two from the list, but the blanks still appear.

I hope I am missing something simple. Any guidance is really appreciated.  
Screenshots below.

Thank you. Inga

 ![2021-01-07 (8)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/d/ad41627eb5b0dfd69788621172da2262527bf3be.png)  
 ![2021-01-07 (6)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/6/96e916894a30b7526aa6ded3ceef1a0cded8f49c.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 7, 2021, 8:19am UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/2 "2021-01-07T08:19:11Z")

</div>

Hi Inga,

What’s happening is that your repeat loop is firing the Clone block repeatedly without any delay. But the “do” section of the Clone block doesn’t have time to complete it’s blocks before the next image clone is created.

So you either need to add a Wait block inside the repeat loop, after the Clone block, and set it to a small number like 0.01 or 0.03. That may work.

Or, you need to do all the cloning first and then use a separate loop to set the pictures of all of the cloned images. That would be my approach.

---

<div class="post-metadata">

**Author:** ![ingamaree](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@ingamaree](https://community.thunkable.com/u/ingamaree)\
**Post date:** [January 7, 2021, 8:45am UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/3 "2021-01-07T08:45:44Z")

</div>

Yes! Thank you that worked. I put a wait of 0.1 seconds after the clone and before setting the random image.

Thanks again Tatiang!

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [January 7, 2021, 9:44am UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/4 "2021-01-07T09:44:59Z")

</div>

Beware, using a fixed wait time like that can cause erratic behavior across devices.

Two alternatives to consider are the data list viewer [JSON Bound Data List Viewer - No More Cloning!](http://community.thunkable.com/t/json-bound-data-list-viewer-no-more-cloning/1041807) and waiting until the operation is finished [Wrapping Asynchronous (then do) blocks into a Synchronous Function resolves unpredictable results](http://community.thunkable.com/t/wrapping-asynchronous-then-do-blocks-into-a-synchronous-function-resolves-unpredictable-results/910511).

These examples are for slightly different circumstances, but hopefully you get the idea.

Happy Thunking

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 7, 2021, 7:58pm UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/5 "2021-01-07T19:58:48Z")

</div>

Agreed, I’m not a fan of wait blocks but sometimes it’s a simpler way to quickly test if something will work.

---

<div class="post-metadata">

**Author:** ![ingamaree](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@ingamaree](https://community.thunkable.com/u/ingamaree)\
**Post date:** [January 7, 2021, 9:35pm UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/6 "2021-01-07T21:35:03Z")

</div>

Thank you. I’ll do some testing and see how I go. Good to know there are options.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:31pm UTC](https://community.thunkable.com/t/cloning-images-returns-blanks/1042304/7 "2024-11-08T13:31:01Z")

</div>


