That's because img1.jpg is just a sample file name for demo purposes as I stated in my last post
In any case what I posted is a demo of the process with an explanation of my suggestion. It's not the actual coding solution for your particular situation because I haven't got your actual code.
I told you in my original post what I was assuming in my reply. You haven't said if my assumption is correct or not.
You need to use the file names of your actual image files.
With you not realisng that, it appears to me either you didn't write the code on your website and you are looking for someone to fix it for you or you have bitten off way more than you can chew - I'm not sure which.
In any case, I don't have the time (well not for free at least) to go through your code and fix it to do what you want.
Your options are either wait for someone else to come long here or elsewhere to help you or hire a professional web developer to fix the code for you.