Fix tests from animated gif layers optimize change

### WHAT

Adds an `assert_frame_dimensions` test helper for testing the size of generated gif frames, and fixes appropriate tests.

### WHY

When we added the last optimized animated gif option, different build boxes generated slightly different sized frames of GIFs. This just tests that they're within a range.