Two-dimensional Greens tensor and local density of states in finite-sized two-dimensional photonic crystals