photo upload refactored + gcm registration