echo \'\';
This is showing up images gr
Try replacing data:image/jpg/png/jpeg; with either data:image/jpeg; or data:image/png; depending on the format of the image. You can't expect it to be both a PNG and a JPEG.
data:image/jpg/png/jpeg;
data:image/jpeg;
data:image/png;