Hi there. The same question has been answered before. Please visit the question How to fix camera problem on the Samsung Galaxy Grand Prime?
Let us know if it works. :)