Update getImageSizeForSource to account for differences in Node.js