'Saves the data in image_data to the location image_path. Returns True/False
to represent success or failure.
image_data: binary image data to write to file
image_path: file location to save the image to'

def _write_image(self, image_data, image_path, obj=None):

    if os.path.isfile(image_path):
        sickrage.srCore.srLogger.debug(u'Image    already    exists,    not    downloading')
        return False
    image_dir = os.path.dirname(image_path)
    if (not image_data):
        sickrage.srCore.srLogger.debug((u'Unable    to    retrieve    image    to    save    in    %s,    skipping' % image_path))
        return False
    try:
        if (not os.path.isdir(image_dir)):
            sickrage.srCore.srLogger.debug((u"Metadata    dir    didn't    exist,    creating    it    at    " + image_dir))
            os.makedirs(image_dir)
            chmodAsParent(image_dir)
        outFile = io.open(image_path, u'wb')
        outFile.write(image_data)
        outFile.close()
        chmodAsParent(image_path)
    except IOError as e:
        sickrage.srCore.srLogger.error(((u'Unable    to    write    image    to    ' + image_path) + u'    -    are    you    sure    the    show    folder    is    writable?    {}'.format(e.message)))
        return False
    return True
