Large group icon files cause the error when loading

Elgg version 2.3.10  - when trying to upload big photo (> 1 Mb) then received the Unresponse error.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in C:\server\data\htdocs\vendor\imagine\imagine\lib\Imagine\Gd\Image.php on line 602

How to prevent such error, possibly checking the file size?

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.