Hi,
i will explain you the things one more clear way.
lets have the snapshot.
so as per the image , the user will select the GRID SIZE, then template and according to this it will select the WIDTH and HEIGHT in PIXELS.
so the CELL WIDTH AND HEIGHT WILL BE ADJUSTED EQUAL TO GRID SIZE IN PIXELS...