Added functionality for uploading images to the server