Unit tests: added a test case to test the 'writeToPNG' image method.

This test opens the saved file and verifies its metadata and content.
The stored image is checked against the initial image buffer, byte per
byte.
Unit tests: debug informations are added at compile time.
Image class: typo fix.