Split the image uploading into its own class

Split the image uploading into its own class and add more exception
handling.