I'm create a theme that will use YouTube thumbnails as the post thumbnail when a YouTube link is present, but I've run into a block with media_sideload_image. It returns an HTML string, not the new attachment's ID. Is there a way to attach a remote image to a post and get its ID as the return value? Thanks in advance for any help.