Hi, I think you may be doing southern Poland a bit of a disservice, you're missing out on a lot of cool things along the way.
First I would take out 1 night each from Prague, Budapest, and Zagreb. Then add 1 night to Krakow, especially if you plan to do daytrips to either Auschwitz or the Tatra Mountains. Krakow is on the same level as Prague and Budapest.
Next I would add 2-3 nights to the city of Wroclaw in southwest Poland. Wroclaw is a convenient halfway stop on the train line between Dresden and Krakow.
Wroclaw is probably one of the most architecturally diverse cities in central Europe, the architectural eye candy around the old center reflects every country that has ruled the city over the centuries - from Polish Gothic to Austrian Baroque and German Modernist. Both the local cuisine and culture reflect this multi-layered history too. For comparison, Wroclaw and Krakow are about the same size.
Wroclaw also has Grabiszynski Cemetery, established in 1881 still stands and is quite well maintained and massive. Includes countless graves of WWI and WWII German and Italian Soldiers. Wroclaw (then Breslau) was part of the German Reich pre-WWII. There is also the Old Jewish Cemetery of Wroclaw, opened in 1856, the cemetery's eclectic layout features many architectural forms and styles on a monumental scale -https://kehilalinks.jewishgen.org/wroclaw/Old_Jewish_Cemetery.html
As for churches, just south of Wroclaw is the Church of Peace (built circa 1650s) in Świdnica. The largest timber-framed religious building in Europe, built as a result of the 30 Years War. Known as "The Sistine Chapel of Wood" - https://whc.unesco.org/en/list/1054/