Remove empty parent directories after image deletion (fixes #15)

My fix leads to extra ftp requests, but I don't know how make it better =(