GIF only supports a 256 color palette, so, it won't do for quality photos. You're right. But for the web, GIF is fine. If you're printing quality photos, you wouldn't want them in a compressed format anyway.
GIF is lossless compression, though 256 indexed colors. PNG is lossless compression with no limit of the # of colors.