Your Data field doesn't represent valid variable for Post, it just returns nothing, look your php script:
$img = $_POST['img'];
It should be
$img = $_POST['image'];
You don't need to add useless functions because your PHP script already comes same functions as replace function.
Data field, should be:
image variable represents post data.
It's simple, that's all.
If you aren't sure, you might consider to get this template.
https://www.scirra.com/store/royalty-fr ... -image-116