But just because a president has the power to declassify (and make classified) anything he wants, it doesn't necessarily mean that it is wise. Showing off your toys is fine when it is a jet with a bathroom covered in gold leaf. When a tweet reveals capabilities that your country spent (literally) billions of dollars on, you are basically wasting taxpayer's money, because now these satellites are going to be less effective. How much less effective probably depends on the adversary, since the big players probably had a good guess about what these imaging satellites could do, but I'll bet ISIS probably didn't (similar to how an unfortunate comment alerted ISIS about being tracked by geotagged images on social media).
It might be okay if experts conversed with the president about the second and third order effects of tweeting the image, and he concluded that it was worth it to release the image. However, given the widely reported disdain that he has for the intelligence community I doubt that such a conversation took place.
Yes, it was perfectly legal for Trump to disclose this photo, but was it wise? Tracking satellites is a hobby even among dilettantes, and now our adversaries can determine where this particular satellite is and when it might be coming over their concerned area. There are other characteristics of this photo that can be used to limit the effectiveness of these recon systems. Many billions USD are spent to provide this capability, and each of these four satellites can stay in orbit only 5 - 8 years limited by the stowed fuel tonnage it uses to prevent reentry.
I don’t know enough about the legalities of the matter to agree or disagree with your statement, but I’m pretty sure that this event will cause the law to be either amended, superseded, or simply broaden the definitions of whatever premises are said to apply.
This twitter thread explains evidence for exactly which satellite took the picture.
https://twitter.com/cgbassa/status/1167578706379988992