Heroku Ajax调用返回错误

I have a php app which worked perfectly on a dedicated server. Once i migrated to heroku the ajax calls started returning errors, such as couldn't load.

For example the following code return error. The album_handle.php file exists on the server.

var url = "album_handle.php?id=" + album_images.id;
$('#ajaxholder').load(url, "",
        function(responseText, textStatus, XMLHttpRequest) {
            $("#dvloader").hide();
            if(textStatus == 'error') {
                $('#ajaxholder').html('<p>There was an error making the AJAX request</p>');
            }
        }
    );

The issue is not with ajax calls in heroku. The ajax calls in here process php gd functions. Since certain php gd functions doesn't work on heroku the issue is raised.