fixed PHP warning and userId as string to avoid gallery app issues