The correct option is
D Pineal
A. Thymus gland is associated with the development of immune system and present on the dorsal side of heart.
B. Pancreas is a heterocrine gland as it acts both as endocrine and exocrine gland. It secretes insulin hormone into blood and act as endocrine gland and when it secretes digestive enzymes and juice through pancreatic duct, it acts as exocrine gland.
C. Pineal gland is a small, rounded and reddish brown gland present at the dorsal side of forebrain. This gland secretes melatonin and serotonin hormones.
D. Pituitary gland is the master gland that regulates the activity of other endocrine glands and secretes many hormones like growth hormone, follicle stimulating hormone, thyroid stimulating hormone etc.
The organ which was considered vestigial till recently but now confirmed to be endocrine gland is pineal gland that secretes melatonin hormone associated with the regulation of rhythm of our body.
So, the correct answer is 'Pineal'.