Bulk action help: replace hotlinked images with local image files

You can look at the import scripts for examples of how to upload files and insert the html for those uploads.