def _retrieve_show_image(self,
                             image_type,  # type: AnyStr
                             show_obj,  # type: sickbeard.tv.TVShow
                             which=None,  # type: int
                             return_links=False,  # type: bool
                             show_infos=None,  # type: ShowInfosDict
                             img_cache_type=None  # type: int
                             ):
        # type: (...) -> Optional[bytes, List[AnyStr]]
        """
        Gets an image URL from theTVDB.com, fanart.tv and TMDB.com, downloads it and returns the data.
        If type is fanart, multiple image src urls are returned instead of a single data image.

        image_type: type of image to retrieve (currently supported: fanart, poster, banner, poster_thumb, banner_thumb)
        show_obj: a TVShow object to use when searching for the image
        which: optional, a specific numbered poster to look for

        Returns: the binary image data if available, or else None
        """
        if not show_infos:
            show_infos = self.gen_show_infos_dict(show_obj)

        if 'fanart_all' == image_type:
            return_links = True
            image_type = 'fanart'

        if image_type not in ('poster', 'banner', 'fanart', 'poster_thumb', 'banner_thumb'):
            logger.log(u"Invalid image type " + str(image_type) + ", couldn't find it in the " + sickbeard.TVInfoAPI(
                show_obj.tvid).name + " object", logger.ERROR)
            return

        image_urls = self._retrieve_image_urls(show_obj, image_type, show_infos)

        if image_urls:
            if return_links:
                return image_urls
            else:
                img_data = None
                image_cache = sickbeard.image_cache.ImageCache()
                for image_url in image_urls or []:
                    if image_type in ('poster', 'banner'):
                        if isinstance(image_url, tuple):
                            image_url = image_url[0]
                    img_data = metadata_helpers.getShowImage(image_url, which, show_obj.name)
                    if img_cache_type and img_cache_type != image_cache.which_type(img_data, is_binary=True):
                        img_data = None
                        continue
                    if None is not img_data:
                        break

                if None is not img_data:
                    return img_data