What to do if assignment is against student's religion?
If you can make an accommodation that allows the student to participate 


without violating his religious observance, and 
without compromising the educational goals of the class, and
without requiring an extreme amount of effort on your part, 


then it is reasonable to make the accommodation.

I regularly miss classes and exams due to religious observance. My school has a very clear policy on the matter:


If students have to miss a class session, exam, or are otherwise unable to participate in a course requirement due to religious observance, they must notify the professor and a certain dean in a timely manner (the definition of "a timely manner" is further specified in the policy)
If said student follows the above requirement, they cannot be penalized for their religious observance and the professor must offer a fair alternative (e.g., makeup exam or assignment)


If your university has no policy on the matter, feel free to adopt mine, and specify it in your syllabus at the beginning of the semester. 

However, I would not take a class where I know the main requirement of a class would violate my religious observance. Indeed, I know people who have refrained from pursuing a career because a non-negotiable required class for that field would require something that violates their religious observance. *

So, if the course is Figure Drawing and someone registers knowing that he cannot draw the human figure... I don't think you are required to let him pass the class by doing still lives instead. If the course is Introduction to Art for Non-Majors, it may be possible to offer an alternative to the portrait assignment.

This applies more generally as well. If a student in good faith (i.e., not to get out of doing work) considers an assignment 


illegal,
unethical, 
compromising to his health/safety, 
etc.


it seems reasonable to offer an alternative assignment if it does not compromise the educational goals of the course.

* See: Can a Kohen become a doctor?