tumblr_backup: unify file opens

Always create the necessary folders if they don't exist already.
New function open_image() for saving images.
tumble: treat empty links as missing

This allows to force a post to text type by clearing the link.
tumble: improve debugging output