added code for complete matching of all components and functions for drawing image boundaries and images on a scaled down grid.