Thanks for posting this. Upgraded to 4.4 last night and published a large article only to see all my images broken.

Implemented the function in functions.php and everything seems to be working again!