Fix SSL and redirect issues for remote image loading