David M. Gregg (Second Cavalry Division) and James H. Wilson (Third Cavalry Division) are missing. I suspect that this image was taken in 1865, after Gregg resigned and Wilson went west. Devin would have been in command of the First Division and Custer the Third Division then. Sandy Forsyth, next to Sheridan, was a staff officer, not a field commander. Custer and Merritt both have two stars on their uniforms: Merritt was a full major general of volunteers while Custer was a brevet major general. Neither held those ranks in the fall of 1864.
This image was definitely taken in the Shenandoah Valley in 1864. From left to right:
Brig. Gen. Henry E. Davies, who commanded a brigade of the Second Division
Brig. Gen. David M. Gregg, commander of the Second Division
Sheridan
Brig. Gen. Wesley Merritt, commander of the First Division
Brig. Gen. Alfred T.A . Torbert, commander of the Cavalry Corps, Army of the Shenandoah
Brig. Gen. James H. Wilson, commander of the Third Division