Resolves: fdo#80160 PNG with 1-bit colormap only show black and white

Change-Id: If0c9950c18e6091fafea47954a4654db436a3a44
(cherry picked from commit 986c0451d05e7bb6ff7edd9f27d0e45532bcd22c)
(cherry picked from commit c1df0c41b602ac144fdde4efcf546549443afa86)
Reviewed-on: https://gerrit.libreoffice.org/9929
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>