Change PhotoClient/ClientAPI to thread-safe and automatically reconnect.