Whenever I activate my custom theme the media is shown in list view only not in grid view. When I checked it by inspect element data is not coming in it and when i try to upload any image it shows me this error, but the image is uploaded in the wp-content/uploads folder then why this error is shown?
List View :
Grid View :