Take a look at Syncbase (https://vanadium.github.io/syncbase/), it has some of these characteristics including secure p2p sync and a SQL-like query language. It's not under active development but might be a decent starting point to pick up from.
Haven't thought much about pricing, to be honest. The main goal would be to support the service as it scales to more users, so that it's self-sustaining.
One way to go would be to start charging a small amount (at most $1/month) for access to premium features, e.g. social features, UI customization, Google Analytics integration, etc.
On the other hand, I don't want for "free" users to have a diminished experience, so maybe a better model would be to give everyone access to all the features, and simply limit free users to 3 albums, or something along those lines.
Let me know if you have thoughts on what might work best!