Simplify dump process

* Put things together back to get_attachments.
* Fix bug when directory not found.

Signed-off-by: Martin Abente Lahaye <martin.abente.lahaye@gmail.com>