Both “rebake” and “Rebuild HTML” actions will trigger it. To debug and get more details about this issue I’ll recommend you to do it for a single affected post at once.
Code. pull_hotlinked_images.rb and process_post.rb
Could you reproduce this issue on try?