fixed delete gallery logics