When Donald Trump met with the NATO countries, there is video of him shoving another leader aside to get to the middle of the front row for the photo of the group. It speaks to Trump's narcissistic personality that he felt he should be the center of attention.
That did not happen at the G-20 Summit in Hamburg. The top photo is of the G-20 leaders. Note that Trump is NOT front row center, but has been moved down toward the end -- a clear sign that he no longer is considered to be a leader by the other nations of the G-20.
There is always a group picture of the G-20 leaders during their yearly meeting, and the American president is always given a spot of honor in that picture (front row near the center), because the U.S. president was considered to be a leader of the free world and a prime architect of world economic policy. Note in the other photos that Bush in 2008, Obama in 2009 and Obama in 2016 all had positions on the front row near the center (and while I didn't include the 2010 through 2015 photos, the U.S. president was given the same position of honor in those also).
That is no longer true. Trump has withdrawn from the Paris Agreement on global change, and has expressed his desire to pull the U.S. out of trade agreements it has signed. Both have made the other members of the G-20 unhappy with Trump -- and they no longer look to the U.S. president for leadership. Trump's place in the photo expresses that feeling very clearly.
I doubt Trump (with his narcissistic personality) was very happy with this demotion, but he has earned it. You cannot be looked to as a world leader when you make it clear to everyone that you come first, your own country second, and the rest of the world is only an afterthought.