Transform matrix and isInPathGroup fix for images