As the error outlines, If you made this custom image, it is likely that it was not prepared and saved properly to be used as an image. Preparing a image for a VM is another lengthy topic, and in this post I will focus on the VM in the failed state and the image deletion. If you need help with the preparation / diagnosis of image failure let me know!
For the Failed VM - The error you are getting is due to the 40 minute OS provisioning timeout. This can be due to a number of reasons, but this is caused by the OS not reporting its status to Azure within 40 minutes of deployment. This can be due to a firewall block, agent failure, or image issue.
Just because the VM shows a failed status, does NOT mean that the VM has failed. It could be up and running, and you can even log into it, but show failed due to the 40 minute timeout. If this is the case, Stop and Start the VM, and make sure that there are no blockers for the agent reporting to Azure. Here is a great article on how to check the status of a VM agent, and troubleshoot why it might not be working.
If the image was not prepared properly, it is likely that the VM is not up and running. If the VM is not up and running (even with the status of 'failed), you will need to delete the failed VM. Once the failed VM is fully deleted, you will be able to delete the image. Azure will still charge you while your VM is still allocated to hardware, which it possibly is even while in the 'failed' state.
To go forward, you will need to figure out why the VM failed so that future deployments are not in a similar state, and then either get the VM into a 'running' state, or get the VM deleted. If you need further assistance, please let me know!