chmod değil mime-type ile aşıyorlar extension koruması olmadığı için
ektekini denermisin bir

$allowed_ext = "jpg, jpeg, JPG, gif, GIF, png, PNG,"; // These are the allowed extensions of the files


burdan ayarlarsın extleri