Fix #645: thumbnail generation for JPEG images fail with latest PHP version
Merge pull request #646 from rmxcc/develop

Fix #645: thumbnail generation for JPEG images fail with latest PHP versions (5.4-5.6)