- Move header() call to before any includes that might output
- Start output buffering at the beginning
- Clean output buffer before sending JSON response
- Add dataType: 'json' to AJAX call to properly parse JSON response
- Add Content-Type header to upload_profile_picture.php
- Add error callback with console logging for debugging
- Remove manual JSON parsing since jQuery handles it with dataType