please can someone help me write the code in a simple way
Oddly enough, yesterday someone had the same need, and I described to them how to write the code in a simple way. However, they then deleted the question, so I cannot refer you to what that other person had already posted and my response to it.
Fortunately, the logs were complete enough that I was able to rescue a partial copy of what I wrote then:
"If you have only 7 images and you need a total of 100, does that mean that you want each image to be copied 14 times, plus another 2 images to make the total 100? If so then use copyfile() instead of imread() / imwrite()"
That is, the proper way to make copies of images is not to imread() / imwrite(): the proper way is to copyfile() the image. You can copyfile() to a different file name if you need to.