diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 344742b..ffc3071 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -31,16 +31,24 @@
     """Base test class for Image API tests."""
 
     @classmethod
+    def skip_checks(cls):
+        super(BaseImageTest, cls).skip_checks()
+        if not CONF.service_available.glance:
+            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
+            raise cls.skipException(skip_msg)
+
+    @classmethod
+    def setup_credentials(cls):
+        super(BaseImageTest, cls).setup_credentials()
+        cls.isolated_creds = credentials.get_isolated_credentials(
+            cls.__name__, network_resources=cls.network_resources)
+        cls.os = clients.Manager(cls.isolated_creds.get_primary_creds())
+
+    @classmethod
     def resource_setup(cls):
         cls.set_network_resources()
         super(BaseImageTest, cls).resource_setup()
         cls.created_images = []
-        cls.isolated_creds = credentials.get_isolated_credentials(
-            cls.__name__, network_resources=cls.network_resources)
-        if not CONF.service_available.glance:
-            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
-            raise cls.skipException(skip_msg)
-        cls.os = clients.Manager(cls.isolated_creds.get_primary_creds())
 
     @classmethod
     def resource_cleanup(cls):
@@ -75,21 +83,33 @@
 class BaseV1ImageTest(BaseImageTest):
 
     @classmethod
-    def resource_setup(cls):
-        super(BaseV1ImageTest, cls).resource_setup()
-        cls.client = cls.os.image_client
+    def skip_checks(cls):
+        super(BaseV1ImageTest, cls).skip_checks()
         if not CONF.image_feature_enabled.api_v1:
             msg = "Glance API v1 not supported"
             raise cls.skipException(msg)
 
+    @classmethod
+    def setup_clients(cls):
+        super(BaseV1ImageTest, cls).setup_clients()
+        cls.client = cls.os.image_client
+
 
 class BaseV1ImageMembersTest(BaseV1ImageTest):
+
+    @classmethod
+    def setup_credentials(cls):
+        super(BaseV1ImageMembersTest, cls).setup_credentials()
+        cls.os_alt = clients.Manager(cls.isolated_creds.get_alt_creds())
+
+    @classmethod
+    def setup_clients(cls):
+        super(BaseV1ImageMembersTest, cls).setup_clients()
+        cls.alt_img_cli = cls.os_alt.image_client
+
     @classmethod
     def resource_setup(cls):
         super(BaseV1ImageMembersTest, cls).resource_setup()
-        cls.os_alt = clients.Manager(cls.isolated_creds.get_alt_creds())
-
-        cls.alt_img_cli = cls.os_alt.image_client
         cls.alt_tenant_id = cls.alt_img_cli.tenant_id
 
     def _create_image(self):
@@ -105,23 +125,35 @@
 class BaseV2ImageTest(BaseImageTest):
 
     @classmethod
-    def resource_setup(cls):
-        super(BaseV2ImageTest, cls).resource_setup()
-        cls.client = cls.os.image_client_v2
+    def skip_checks(cls):
+        super(BaseV2ImageTest, cls).skip_checks()
         if not CONF.image_feature_enabled.api_v2:
             msg = "Glance API v2 not supported"
             raise cls.skipException(msg)
 
+    @classmethod
+    def setup_clients(cls):
+        super(BaseV2ImageTest, cls).setup_clients()
+        cls.client = cls.os.image_client_v2
+
 
 class BaseV2MemberImageTest(BaseV2ImageTest):
 
     @classmethod
-    def resource_setup(cls):
-        super(BaseV2MemberImageTest, cls).resource_setup()
+    def setup_credentials(cls):
+        super(BaseV2MemberImageTest, cls).setup_credentials()
         creds = cls.isolated_creds.get_alt_creds()
         cls.os_alt = clients.Manager(creds)
+
+    @classmethod
+    def setup_clients(cls):
+        super(BaseV2MemberImageTest, cls).setup_clients()
         cls.os_img_client = cls.os.image_client_v2
         cls.alt_img_client = cls.os_alt.image_client_v2
+
+    @classmethod
+    def resource_setup(cls):
+        super(BaseV2MemberImageTest, cls).resource_setup()
         cls.alt_tenant_id = cls.alt_img_client.tenant_id
 
     def _list_image_ids_as_alt(self):
