[PATCH v5 6/6] gdiplus: Make function which using GdipGetImage* more reboust