final version with photo upload support