first synchronous working version of photo upload