In the case of an image with an extremely large number of frames specified, the process will be killed due to lack of memory while allocating memory for loading image.
Make it possible to limit the maximum size of an image so that it does not crash when loaded from an untrusted source.