Ensure you use the proper header type ( image/jpeg , image/png , image/gif ) that matches the image data being provided..