This was the kind of error I was getting...
PHP Error
PHP Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SOS parameters for sequential JPEG
PHP Warning: imagecreatefromjpeg(): 'uploads/58a0ca1e227b5_20170210_170151.jpg' is not a valid JPEG file in UploadHandler.php on line 562
I wasn't exactly sure what that meant but since these files were loadable on my Mac there had to be a way to get them loaded via GD too, and I found it. There was a runtime configuration documentation page for the PHP GD library that described an INI parameter that could be set that would make GD ignore warnings while loading JPEGs. After setting the gd.jpeg_ignore_warning parameter to 1 I was able to load these seemingly 'corrupted' JPEGs.
Here's the code I used to set the parameter. I placed this right before any of the calls to the GD functions.
PHP
ini_set('gd.jpeg_ignore_warning', 1);
Interestingly from version 7.1 of PHP, the documentation says this - The default of gd.jpeg_ignore_warning has been changed from 0 to 1.
-i