Pruning By Explaining Revisited: Optimizing Attribution Methods to Prune CNNs and Transformers