improved how images are deleted, goes through library layer