created functionality for image uploading