// All these values will be pre-validated with @NotNull constraints
// so they are safe to use
byte[] data = value.getData();
String fileName = value.getFileName();
ImageType type = value.getType();
// Verify the GIF type is correct5, has the correct extension and
// the data header is either GIF87 or GIF89
if (allowedTypes.contains(ImageType.GIF) &&
type == ImageType.GIF &&