adds galleries and images tables