some improvements on photo upload