added errorCallback for image and ajax