This PR aims to resolve the issues surrounding the optimize-images script, at least in the short term, in order to unblock other work.
Problems: Our optimize-images script was taking a very long time to run (~7 minutes in CI, when successful). This led to two problems:
It was near impossible to run the script locally.
CI jobs would often get killed on the optimize-images step.
Resize the images in images/events prior to optimizing them, similar to what is done for the images in images/team. This solution on its own reduced the run-time of the script to ~30 seconds locally on Amy's laptop, which is comparable to the run-time of the script back when it was originally written.
EDIT: Copy/resize/optimize the images in batches of 32 at a time. The reason why the CI job was being killed is because the script would run out of memory, however this change should resolve that while also keeping build times reasonable (~30 sec locally/when deploying on caffeine, ~3 min in CI). As a temporary fix, this PR also replaces the images in images/events with their resized + optimized versions. (For some unknown reason, Solution 1 is not sufficient to solve Problem 2.)
This PR also adds some logging to the script so we can get a (slightly) better sense of where the script is getting stuck.