its very straight away andn no more coding required, check below code
<apex:page showHeader="true" sidebar="false">
<apex:form >
<chatter:userPhotoUpload showOriginalPhoto="true" />
</apex:form>
</apex:page>
output
![image](https://www.thephani.com/content/images/2014/Aug/Screen-Shot-2014-08-16-at-11-01-30-AM.png)
Hover above smiley and click it then following screen will appear
![](https://www.thephani.com/content/images/2014/Aug/Screen-Shot-2014-08-16-at-11-01-39-AM.png)
Happy coding!!!