--- a\src\iup_image.c	Mon Jan 29 09:17:08 2018
+++ b\src\iup_image.c	Mon Jan 29 09:58:56 2018
@@ -613,11 +613,11 @@
 
 void* iupImageGetImage(const char* name, Ihandle* ih_parent, int make_inactive)
 {
-  char cache_name[100] = "_IUPIMAGE_IMAGE";
+  char cache_name[128] = "_IUPIMAGE_IMAGE";
+  const char* native_name = NULL;
   char* bgcolor;
   void* handle;
   Ihandle *ih;
-  int bg_concat = 0;
 
   if (!name)
     return NULL;
@@ -625,65 +625,46 @@
   ih = iImageGetImageFromName(name);
   if (!ih)
   {
-    const char* native_name = NULL;
-
-    /* Check in the system resources. */
-    handle = iupdrvImageLoad(name, IUPIMAGE_IMAGE);
-    if (handle) 
-      return handle;
-
     /* Check in the stock images. */
     iImageStockGet(name, &ih, &native_name);
-    if (native_name) 
-    {
-      handle = iupdrvImageLoad(native_name, IUPIMAGE_IMAGE);
-      if (handle) 
-        return handle;
-    }
-
     if (!ih)
       return NULL;
   }
-
   handle = iupAttribGet(ih, "_IUPSTOCK_LOAD_HANDLE");
   if (handle)
+  {
     return handle;
-
-  bgcolor = iupAttribGet(ih, "BGCOLOR");
-  if (ih_parent && !bgcolor)
-    bgcolor = IupGetAttribute(ih_parent, "BGCOLOR"); /* Use IupGetAttribute to use inheritance and native implementation */
+  }
 
   if (make_inactive)
     strcat(cache_name, "_INACTIVE");
 
+  bgcolor = iupAttribGet(ih, "BGCOLOR");
+  if (ih_parent && !bgcolor)
+    bgcolor = IupGetAttribute(ih_parent, "BGCOLOR"); /* Use IupGetAttribute to use inheritance and native implementation */
   if (iupAttribGet(ih, "_IUP_BGCOLOR_DEPEND") && bgcolor)
   {
     strcat(cache_name, "(");
     strcat(cache_name, bgcolor);
     strcat(cache_name, ")");
-    bg_concat = 1;
   }
-  
+
   /* Check for an already created native image */
   handle = (void*)iupAttribGet(ih, cache_name);
   if (handle)
     return handle;
 
-  if (ih_parent && iupAttribGetStr(ih_parent, "FLAT_ALPHA"))
-    iupAttribSet(ih, "FLAT_ALPHA", "1");
-
-  /* Creates the native image */
-  handle = iupdrvImageCreateImage(ih, bgcolor, make_inactive);
-
-  if (ih_parent && iupAttribGetStr(ih_parent, "FLAT_ALPHA"))
-    iupAttribSet(ih, "FLAT_ALPHA", NULL);
-
-  if (iupAttribGet(ih, "_IUP_BGCOLOR_DEPEND") && bgcolor && !bg_concat)  /* _IUP_BGCOLOR_DEPEND could be set during creation */
+  /* Check in the system resources. */
+  handle = iupdrvImageLoad(name, IUPIMAGE_IMAGE);
+  if (!handle && native_name)
   {
-    strcat(cache_name, "(");
-    strcat(cache_name, bgcolor);
-    strcat(cache_name, ")");
+     handle = iupdrvImageLoad(native_name, IUPIMAGE_IMAGE);
+     if (!handle)
+        return NULL;    
   }
+
+  if (ih_parent && iupAttribGetStr(ih_parent, "FLAT_ALPHA"))
+    iupAttribSet(ih_image, "FLAT_ALPHA", NULL);
 
   /* save the native image in the cache */
   iupAttribSet(ih, cache_name, (char*)handle);
