thank you Damien, yes indeed it compiles now. So I was doing it wrong once more :D Sorry for wasting your time, I try to be careful but I make stupid mistakes at times. Will try to be more careful next time.
The layout problem still remains though for the Pdf. But I suspect thats a Latex problem. You can see the issue at page 34 of the pdf. I have several images with the layout of the page when it comes to images like sometimes it adds too much whitespace between text and image and now this. Again maybe I am doing something wrong here.