Free your mind ....
Search first for "<img src" - check out the grep/egrep/fgrep commands - any line containing that - search for your blank alt="" statement - use a
sed command to remove it.
Then run through and insert your new alt="" by searching/replacing border with alt="" border
test it out on a smaller file so you can see if it all works before hitting all your htm/html files.