Hi and welcome to Healthcare magic.Thank you for the query.
This can be both but also some chroinc lung disease so you need heart and lung work up. Pneumonia
may persist or leave scar tissue in lung which can cause your symptoms even 2-3months after. So you should repeat xray lungs to verify this.
Wish you good health. Regards