Update getImageSizeForSource to account for Node.js