If you delete a note that contains files, those files will still remain in the attachments folder. A possible solution is to track which files are associated with each note and remove them when the note is removed