Safely retrieve data from an untrusted server using image dimensions.