The string being made looks like this on each iteration...
http://site.com/productphotos/gallery_200-l.jpg
...which does not match what you quoted...
http://site.com/productphotos/gallery200-100-l.jpg
It could also be because you have allow_url_fopen() off. If you can't change it and it's off, use a library such as cURL to get the image.
Also, you are making 800 requests from that loop, which is quite an amount. You can give PHP a breather by using sleep(1) in that loop and making sure the script doesn't time out with set_time_limit(0). Of course this won't be fast enough to do in a end user initiated HTTP request, so try and run this process from a scheduler such as a Cron job.
If you really want a specific answer, tell me how it doesn't work - any errors, is the image saved but wrong, etc.