Add Image field to CPT

My solution works but it is a cop-out. I went to CMB2 for adding fields and it works beautifully.

Some people might specifically be looking for an answer to this, so I know this is not helpful for that, but switch to CMB2 if you can.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)