Yes, you have to permit your photo to be taken at booking. If you don’t, you’ll be held in place so that it can be taken, and that will probably be brought to the judge’s attention at sentencing. Actively fighting to keep from having your photo taken may result in an additional charge of resisting arrest, disorderly conduct or even obstruction of justice. If you have a genuine religious objection to having your picture taken, I guess you could try to persuade the booking officer, but I doubt it’d work and there just wouldn’t be time for your lawyer to run to court and get an injunction.
My dad insists that, when Ohio began requiring photos on drivers licenses back in the 1960s, a friend of his told the BMV he had a religious objection as a Druid (!) to having his photo taken. The BMV allegedly bought it and, instead of a photo, a small gray square with the words “RELIGIOUS EXEMPTION” appeared on his license. I, however, have my doubts.