'Creates an image.
Args:
prefix: the prefix to use e.g. split vs mongo
dimensions: tuple of (width, height)
color: the background color of the image
name: the name of the image; can be a format string
locked: whether or not the asset should be locked
Returns:
StaticContent: the StaticContent object for the created image'

@classmethod
def create_image(cls, prefix, dimensions, color, name, locked=False):

    new_image = Image.new('RGB', dimensions, color)
    new_buf = StringIO()
    new_image.save(new_buf, format='png')
    new_buf.seek(0)
    new_name = name.format(prefix)
    new_key = StaticContent.compute_location(cls.courses[prefix].id, new_name)
    new_content = StaticContent(new_key, new_name, 'image/png', new_buf.getvalue(), locked=locked)
    contentstore().save(new_content)
    return new_content
