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

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