I would recommend Inkscape (open source) for things like this, you load the image into a layer and then make a new layer on top of it and use the vector-drawing tools in inkscape to draw the grid.