Well I can't help you with your actual code, because I can't read your mind to see it.
To be frank, this isnt a 'trival' topic, so if you dont have much experience coding, its might well be trickly to get it right. Might be worth looking for a developer (no I am not offering!)
But inspired by this thread, I just built a quick rough demo
Loads photographs along the route (only have photos within the British Isles). The boxes, have default values that work, just press the Submit button.
The main part that needs work, is how to limit the number of results. Currently it just takes 100 divided by number of boxes. Then each search is fired off, asking for that many results. It does also enforce a minimum, to prevent 0 being used :)
This is not ideal because if, there is uneven coverage, say a large number of results in one box, but few in others. Will end up not showing many results, because the busy box, will still have the same limit.
To combat, that could actully ask for many more results from each box, but reduce the number of results actully displayed, once you have all the results back.
Alternatively could send all the bboxes to the server, and let it use them all when finding images. It could then take care of enforcing a good limit.
Doing the server side component, is something can'y really help you with.