[postgresql] several fixes in DELETE.sql + new procedures to delete entries from tex_image table