delete product picture gives error

When I confirm the deletion of a product picture with “[” and “]” in the file name, Dolibarr 3.3.1 gives messages and does not delete the picture, while there were no messages when uploading or showing it. Pictures with other file names are deleted without messages.

Messages when trying to delete:

Warning: Invalid argument supplied for foreach() in dolibarr/htdocs/core/lib/files.lib.php on line 757
and
Warning: Cannot modify header information - headers already sent by (output started at dolibarr/htdocs/core/lib/files.lib.php:757) in dolibarr/htdocs/main.inc.php on line 825

I think an adjustment in the PHP code has to be made to prevent these errors and to make the deletion possible.
Apart from this, is there a way to delete these pictures?

You can delete manually files. Make a scan of file into dolibarr “documents” directory.

Fix should be included into 3.4