I don't know Polish so that it is really hard to retrace the code. But you missed some points:
There are two versions of info headers with different sizes which can be identified using the biSize member: BITMAPINFOHEADER and BITMAPV5HEADER
When biCompression is BI_BITFIELDS, these bitfields are stored after the info header.
Your code supports only 24-bit RGB bitmaps. So you should check if the file is in that format (biBitCount == 24).
You can read the pixel data from file offset bfOffBits with size biSizeImage which includes the padding bytes. But your code starts reading after the info header which is the location of the bitfields table or still within a BITMAPV5HEADER.