Ah, I've never used facebook, so I didn't know about that feature. My guess is that they store x and y coordinates for upper left corner, and also width and height of the square.
I'd change the phototag table from above to
table phototag(photo_id, tag_id, x, y, width, height)
If you keep the x and y coordinates respective to the photos upper left corner and always sticks the image tags in a div (photodiv) using relative or absolute positioning, with no margin or padding, then you can show the square's outline by appending a new div (squarediv) inside the photodiv. Use absolute positioning for squarediv, set its width and height according to width and height from the db and give squarediv a 1pt border.
When people assign tags, you could use a similar approach as above. When user clicks photo
1. addEventListener/attachEvent for mouseup/onmouseup
2. addEventListener/attachEvent for mousemove/onmousemove
2. squarediv is appended to imagediv
3. mousemove changes width and height of squarediv
4. mouseup removes mousemove and mouseup events and also stores coordinates, width and height
Another approach, with less precision is to just divide each image into sufficiently small squares and let the user click as many squars is applicable. In this case you'd display the image in each square as if it was a tilemap.
It might also be possible to allow the user a single mouse click and then use image analysis to decide what area was tagged. But that is beyond my knowledge. I don't even know if Imagick has support for this kind of thing or not.