Can contact images be uploaded other than by editing a contact record?
Uploads via Webform are indeed broken in 4.7, but have been fixed with 5.0.

Webform CiviCRM inserts the image_URL value in the database as the path to the webform upload, e.g. /sites/default/files/webform/NNNN.ext. The CiviCRM handler (CRM/Utils/File.php) expected CiviCRM-style image URLs of the form /civicrm/contact/imagefile?photo=NNNN.ext, and so mangled the path twice, once on reading it and then when it ran getFileURL on it.

Thus, anything dependent on $imageURL would break for images uploaded through Webform or other external mechanisms.

The issue was reported on Webform CiviCRM Integration as Contact Image Upload field integration not working with 4.7, and later addressed in the related GitHub issue CRM-21778 - Contact image uploaded from drupal webform don't render on the summary page.

I was able to apply jitendrapurohit's patch from GitHub cleanly to 4.7.31; the fix is contained entirely within CRM/Utils/File.php.