To solve this annoying error, you need to change the path of the old uploads folder to the new one. Follow these steps to solve the problem:
- Log in to your WordPress admin panel (wp-admin).
- In the left menu go to Settings»Media.
  
- In the Store uploads in this folder field, enter wp-content/uploadsand click Save changes.
  
- Now you are done, go and try to upload files to the media library again.
NOTE: make sure that the Store uploads in this folder field contain wp-content/uploads only.