Fix automatic image URL generator

Was missing the 'img.' subdomain. By adding some JavaScript it can now be consistent with the hard-coded example format and thus not have to worry about changing it in both places.