fixed: png compile problems (deprecated png_set_gray_1_2_4_to_8), thanks to J.Ehnes for the report

(cherry picked from commit 39c42e9f8e17a6a7bbc7972912f5124fb8f7349b)
fixed: deprecated jumpbuf (thanks to A. Halm for the patch)

(cherry picked from commit 11b206bf344dd4f1686d19f006047198704a7e1f)