improve the pic sharing sample