Model to localize gauge and tensor fields on thick branes