fix delete thumbnail function