Fix https issue: Use wp_upload_dir path plus filename

This PR uses the wp_upload_dir image path, plus the php basename() function to get the correct image filename, to generate the correct source and destination image files. I note you have already solved the https problem with a previous patch, but this gets you out of hacky string matching on the full file URL altogether. Hope it is helpful!