1) Just before activating the plug-in, set a boolen variable to "TRUE",I tried to look into the code to see what can cause that, and my hypothesis is this: map/event data can tell for an image to be shown, and it can tell it to be erased. There is some plugin (some thing called TDDP_BindPicturesToMap) that adds some additional functionality, and this plugin does some processing with a picture after it is finished loading. However, since the loading seems to be asynchronous, it can actually finish AFTER the map/event processing has instructed the image to be erased. In this case, this postprocessing function added by TDDP_BindPicturesToMap tries to use some information about the image that has already been deleted due to "erase picture" command.
So what causes an image to be "erased" before it is done loading in the first place? It's a combination of the image being erased very quickly after being first shown (either because it's part of an animation, or because of skipping) and possibly slow loading (either due to disk or CPU performance).
Either way, I would say the plugin is at fault here since I would not call this situation the fault of the game developer - the plugin developer should have considered this can happen. The fix would be fairly simple in the plugin code.
This analysis is done based on looking at the code for like 5 minutes so I may be off with some things.
2) When the plug-in is done, set that variable to "FALSE",
3) Put the "erase picture" command into a subroutine that waits for that variable to turn "FALSE".
4) In your source code, use that subroutine instead of the actual erase command wherever a picture needs to be removed.