GD is a graphics addon to PHP. to create images.
If I was you, Id create a little indexing script that indexes a directory of images and saves the filename location size etc... into a mysql dataabse. It will be faster to do that then to store the image in mysql.