PHPCR fixes + add gallery support