Trying to reduce imageOptim operations