Break at unix or windows line endings
Generate a 1x1 image for 0 sized frames
Drop unused frames
Use our flags value from the json
As we remove frames, we need to adjust the index we are comparing to with that in mind