Is there a way to remove the preview icon of a gif or jpeg file?
As mankoff said, the large size is probably a resource fork (with things like previews).  To confirm this, use the Terminal command ls -l@ /Volumes/Database/WebFolder/imgs/confirm.gif -- you'll probably see something like this:

$ ls -l@ /Volumes/Database/WebFolder/imgs/confirm.gif
-rw-r--r--@ 1 www  www  539 Nov 18 09:39 /Volumes/Database/WebFolder/imgs/confirm.gif
        com.apple.FinderInfo     32 
        com.apple.ResourceFork  40748 


If it doesn't show a 40kb resource fork, report back so we'll all have a better idea what's going on.

As long as the image is just for web use, a big resource fork isn't really an issue, since the web server will only serve the data fork (which is just 539 bytes long).  If want to compact the file anyway, use the command xattr -d com.apple.ResourceFork /Volumes/Database/WebFolder/imgs/confirm.gif to remove the fork.