Please follow all the steps to show image in cms pages. Here i have taken custom collumn name "banner" which is created in "cms_page" table. Please change your code according to your column name.
Step 1:- Please create one block file named Image.php under path
Below code is for get image from custom ...
If you check the code around the line specified in the error you will see why it doesn't work :)
$allowImageTypes = ['gif', 'jpg', 'jpeg', 'png'];
So basically, you can't upload a PDF and expect it to be treated as an image since this is not allowed file extension.