Not a problem at all. I rarely get to do much coding work at my current job, so I hang around the forums to help people out and keep my python skills sharp.
Also for future reference if you ever need to find out if picture element source image exists, you can use arcpy.Exists to check. I wasn't sure it works on picture elements, but since JPEGs can be used as a layout element or as a dataset in ArcMap, you can.
I used the map document you uploaded and it did return False that the source image file wasn't in existence anymore. It would be fairly easy to adjust the code we already worked on to check all picture elements in your map documents for broken links this way, as opposed to broken data links in your map layers. You could have it write to a text file which ones had broken links to picture elements and which map documents they were in and only work on those. I'm mentioning this since I said earlier you couldn't do this with arcpy but you actually can.
Back again. It actually wasn't working. Started to mess with it some more and now have it working. I think the map doc I was looking at after the initial "success" was one I changed manually a few days ago only to forget which one.
Anyway, I had to add overwriteOutput = True since the documents were already in the folder. Then it worked.
For what it's worth, the Element Name stayed the same (ie Jackson...) while the picture source path changed to the new folder:
Also, thanks for the tip on arcpy.Exists. I'll be piecing that together next.
Actually that is pretty interesting since the name obviously did change when the original link was broken, but when a new valid source path was made it didn't update the name. Obviously if you wanted to change the name property when the imageSource property was changed you could, but good to know for the future. I do more work with the arcpy mapping module than anything else(just had a script finish producing ~3600 map documents) so something for me to keep in mind.
Yes.
Not working/old path: \\Jackson\gis_dept\Data\Images\County-logo-1x1Small.JPG
Working/new path: P:\Images\County-logo.JPG
I thought it wouldn't be bad either? The script I posted above, and again here, seems nice. But it doesn't want to work in a case where the path is broken. So, line 3 is calling the mxd I zipped above. And, as noted, because of the broken path, the pictures aren't in the mxd. That's why I think this script isn't working. In other words, I think the pictures have to be there for the script to work.
Description: find a picture element using a wildcard and then change the picture's data source
import arcpy
mxd = arcpy.mapping.MapDocument(r'R:\AtlasMaps\ATLAS_MAPS_17\New folder\1st_District_B2.mxd')
for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT", "*logo*"):
if elm.name == 'County-logo-1x1Small':
elm.sourceImage = r'P:\Images\County-logo.JPG'
print '{} changed'.format(elm.sourceImage)
mxd.saveACopy(r'R:\AtlasMaps\ATLAS_MAPS_17\New folder\1st_District_B3.mxd')
del mxd
Taken from here: ListLayoutElements—Help | ArcGIS for Desktop
Hm, that is interesting. I'll keep that in mind.