Hi there! The same question has been solved before, check out the question How to fix camera problem on the Samsung Galaxy Grand Prime?
Hope that helps!