Strange error

I have a strange problem with my game. Shortly after starting it (after being compressed and installed), it gives out this error message:
 

'Cache' line 106: RGSSError occured

failed to create bitmap
And then closes down.

Does anyone know what could be the cause of this problem? It doesn't occur in playtesting mode.
It tries to access a picture that no longer exists.

Two possible causes (could be others, those I can think of at the moment):

1) you deleted an image file from the project that is still needed

2) you placed an erase picture command for a picture that is already erased, or a move picture after it has been erased or something similiar
I have two situations where I encounter the issue, and one of them involves erasing a picture. However, I can't see anything being wrong with it.

Here is one of the events described in two screenshots. The problem occurs during the erasing of the image.

problem_sc_1_zpsk9yqrxpw.jpg


problem_sc_2_zpssypucorp.jpg


The other situation where the problem occurs does not involve any pictures or parallel events, so I don't know what could be the cause there.

Original thread: https://forums.rpgmakerweb.com/threads/strange-error.36275/