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