Fix duplicate jpgs breaking match in cleanup

Also tweak cleanup function to actually remove the target files.