I ran into the same issue, instead of setting up a completely new Elastic Beanstalk app, I connected to the EC2 instance via SSH and re-installed PIL (or Pillow).
On EC2 instance, I ran the following commands:
source /opt/python/run/venv/bin/activate
pip uninstall PIL
pip install PIL
Now PIL supports jpeg encoding =)