Improve SgiImagePlugin test coverage
Looking at SgiImagePlugin, I see that an error for the incorrect number of bands will never be raised. https://github.com/python-pillow/Pillow/blob/507fefbce4c3b8c46c6c21483d488884f1b5a8e1/src/PIL/SgiImagePlugin.py#L160-L176
Only L, RGB and RGBA modes are supported when saving. https://github.com/python-pillow/Pillow/blob/507fefbce4c3b8c46c6c21483d488884f1b5a8e1/src/PIL/SgiImagePlugin.py#L137-L139
In the first code snippet, you can see that z = len(im.mode) would be set z to the correct values of 1 for L, 3 for RGB and 4 for RGBA. It is later set to 1 if dim is 1 or 2, but dim only has those values for L mode images, which should be 1 anyway.
So the error can be removed.
After some code simplification, this adds coverage for the lines missing at https://app.codecov.io/gh/python-pillow/Pillow/blob/main/src%2FPIL%2FSgiImagePlugin.py