The member
ifstream pFile;
of class BMPImage is not being initialized, so when you use it in member functions it isn't valid. Instead you are locally defining a different pFile instance in the constructor. These should probably be the same instance.