Suppose I have a d-dimensional vector $x$ whose components $x_i$ are each i.i.d. Bernoulli with some $\theta_i$. $\theta$ is then the vector of parameters and $$ p(x|\theta) = \prod_{i=1}^d\theta_i^{x_i}(1-\theta_i)^{(1 - x_i)} $$ I have a dataset of vectors (all i.i.d) like $x$ - basically each vector is a black and white image where the pixels are either labelled 0 or 1. I want to estimate $\theta$ with the Maximum A Priori (MAP) method with a $Beta(2, 2)$ prior for each $\theta_i$.
So far what I have is this, ignoring normalization constants:
$$ p(\theta|x) \propto p(x|\theta)p(\theta) $$
$$ p(\theta|x) \propto \prod_{i=1}^d\theta_i^{x_i}(1-\theta_i)^{(1 - x_i)} \theta_i(1-\theta_i) $$
$$ p(\theta|x) \propto \prod_{i=1}^d\theta_i^{x_i +1}(1-\theta_i)^{(2 - x_i)} $$
The expression inside the product is another Beta distribution in disguise so $$ p(\theta|x) \propto \prod_{i=1}^d Beta(x_i + 2, 3 - x_i) $$
At this point I choose the mode for each individual Beta distribution, which is
$$\frac{x_i + 1}3$$ and so the MAP estimate is
$$p(\theta|x) \propto \prod_{i=1}^d \frac{x_i + 1}3$$
That's only using one vector from my dataset though. How do I extend it to include all the data? I don't know how to get the mode of a product of a product.