To rename photos based on exif data, use exiftool:
exiftool -ext jpg '-FileName<CreateDate' -d %Y%m%d_%H%M%Se .
Note that the -c is to include a numerical suffix in case images are duplicates or taken at the same time.
Another option is to use exiv2:
exiv2 -r'%Y%m%d_%H%M%S' -F *.jpg
With the -F option, exiv2 will add _1 _2, etc to the name pattern.