Can't remove RectTransform because Image (Script), Image (Script) depends on it
//You Have to Destroy what ever u want but add .gameobject after
Gameobject x; //x is what ever u want to destory if its ui object u can destory it
Destroy(x.gameobject);