How can I truncate filenames after X number of characters using Automator or AppleScript?
Do we have to be concerned about the names being the same? If not, this should work for you as an embedded AppleScript in Hazel:

tell application "Finder"
    set original_name to name of theFile
    set short_name to characters 1 thru 10 of original_name as string
    set name of theFile to (short_name &amp; ".png" as string)
end tell


You'd set Hazel to run this rule on "any file" then "Run AppleScript" (embedded).

You can change the number of characters easily. I picked ten. Do what works for you. Also, I guessed that your images are ".png" files-- you would change that to ".jpg" or whatever.

I hope this helps you!