Possibly the issue with your script is that you have an extra "done" in the middle of it. Your main loop will only ever produce one picture, scp it, then the script will exit (possibly with a syntax ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results