There is no need to imagine a country where mugshots are freely available, even is that person is later released without charge, that already exists, and we know what the practice does.
How does your question relate to publicity at all? Habeas corpus covers that situation, assuming the country you're imagining complies with habeas corpus standards.