gdiplus: Move ImageAttributes mapping into a helper function.