Hi there! The same question has been answered before. Visit the question How to fix camera problem on the Samsung Galaxy Grand Prime?
Hope that helps!