@Override
    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource) throws ImagingException, IOException {
        final GifImageContents imageContents = readFile(byteSource, false);

        final GifHeaderInfo ghi = imageContents.gifHeaderInfo;
        if (ghi == null) {
            throw new ImagingException("GIF: Couldn't read Header");
        }

        final List<GifImageData> imageData = findAllImageData(imageContents);
        final List<BufferedImage> result = Allocator.arrayList(imageData.size());
        for (final GifImageData id : imageData) {
            result.add(getBufferedImage(id, imageContents.globalColorTable));
        }
        return result;
    }
See {@link GifImageParser#readBlocks} for reference how the blocks are created. They should match the code we are giving here, returning the correct
class type. Internal only.
src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java