Hey, there! These are good questions.
First, does it feel natural & comfortable to you? Can you play the chords smoothly & change between them? If so, then you doing fine. The C major chord looks good, but it looks like you thumb might be awkward on the D major chord. You might find it more effective to move your thumb a little more to the bass side of the neck to oppose the pressure of your fingers on the treble side.
If you haven't yet, I encourage you to work through the Guitar Fundamentals course. In particular this tutorial covers basic open chords with the proper mechanics. This lesson is the D major chord & the next is the C major chord.
https://www.guitartricks.com/lesson/31266
And I cover general fretting hand mechanics here.
https://www.guitartricks.com/lesson/10654
In lesson 2 in particular I discuss what I call the axis of power that is effectively keeping opposing pressure between your fretting fingers & thumb.
Hope that helps!
Christopher Schlegel
Guitar Tricks InstructorChristopher Schlegel Lesson Directory