Why is the photo quality terrible in Automator?
I don't know why, but it seems to save the image as a 201x201 pixel tiff file.

You could also install imagesnap with brew install imagesnap and then use something like /usr/local/bin/imagesnap ~/Desktop/$(date +%y%m%d%H%M%S).png in a Run Shell Script action.