Feature #5157 :
- avoiding null pointer exception on copy of media that deals with form
- fixing non deletion around form documents related to gallery resources