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
Hover above smiley and click it then following screen will appear
Happy coding!!!