Internal Server error 500 when uploading images from ODK Collect

I am using Aggregate v1.7.0, with Tomcat in AWS.
Even after changing the max_allowed_packet, the issue still seems to be there.