文件名不正确iOS8文件上传

Hello I am trying to create a simple Multiple File Uploader that works on mobile devices. Right now I am testing on iOS 8.

When I upload a file from my iPhone 6 Plus I am finding that the script is not getting the filename from the form when its submitted. It always defaults to image.jpg even when uploading a png. I have been looking into the File API but can't find what I'm looking for. I am able to change the filename so that all files upload without replacing each other but I would like to at least keep the filename. Any help?

Heres what I have for code.

index.php

<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Multiple File Upload with PHP</title>
</head>
<body>
    <form action="upload.php" method="post" enctype="multipart/form-data">
        <input type="file" id="file" name="files[]" accept="image/*">
        <input type="submit" value="Upload!" />
    </form>
</body>
</html>

upload.php

<?php
$valid_formats = array("jpg", "png");
$max_file_size = 1024*5000;
$path = "uploads/"; // Upload directory
$count = 0;

if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
    // Loop $_FILES to exeicute all files
    foreach ($_FILES['files']['name'] as $f => $name) { 
        if ($_FILES['files']['error'][$f] == 4) {
            continue; // Skip file if any error found
        }          
        if ($_FILES['files']['error'][$f] == 0) {              
            if ($_FILES['files']['size'][$f] > $max_file_size) {
                $message[] = "$name is too large!.";
                continue; // Skip large files
            }
            elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){
                $message[] = "$name is not a valid format";
                continue; // Skip invalid file formats
            }
            else{ // No error found! Move uploaded files 

                if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$count.'-'.$name ))
                $count++; // Number of successfully uploaded file
        }
    }
}
}
?>