refactor to have access to frame, useful for images where we need mime_type in addition to content