Issue #1537450 by Liam Morland: Undefined index: filename in insert_element_process() when removing a file that is used twice.