As I looked into the code handling note deletion, I didn't see any code that deletes resources when a note is deleted. I tested it and indeed, the image in the note stays in the resources directory after I deleted the note.
My modified version (that keeps markdown files), when a note is deleted, besides deleting the resources with the files, there is also the code that would delete the resources in Joplin's config directory, but so far I have yet enabled this part yet. Will probably just enable it in the next upload.