Putting the width and height will prevent "jumping around" as the page is being displayed. I think Getimagesize would really delay things as every time the page is displayed, it has to traverse the directory and do lots of checks. The viewer would see a blank page until every image is checked, which could take 10 or more seconds on a busy server.
I am considering saving both the images and sizes in a database at upload time rather than in files, which will remove some of the overhead to upload time. Presumably the database access will be less efficient than a flat file though?
You could use an INI file. Right now I am using INI files rather than a MySQL database (long story) and getting pretty good results.
I am using a slightly modified version of Jorgen's great INI Functions PHP library. (the modifications are: add keys to the end of a section instead of the beginning, add sections to the file in alphabetical order, added ini_connect_ro (read-only))
Then in your PHP viewing page, grab the info from the database/INI into an array and you can do quick array matching with minimal CPU/HD load. If a filename matches, you grab the width and height from the array. If not, you suppress width and height tags.
As for getting this data INTO the database...
How are images uploaded to the site?
If it's a special upload page and nobody will be FTPing, then every time a picture is uploaded/replaced/deleted, the width, height, and filename should be written into the database/INI.
You could also write an "optimize.php" script to traverse the directory and check imagesizes on all the pictures in that directory and rewrite the database.
If the image size is somewhat predictable, you could put invisible pixel horizontal and vertical lines to make each table cell "at least" as big as a minimum value.