Most likely the PDF generator is not able to properly catch the mime header that the file request handler sends, and therefore because of the lack of extension in the first image is not able to properly recognize the file as an image file. Perhaps you can work around it by using the image viewer or if that doesn't help create your own request handler that is able to use the proper image name to lookup the image.
Your request handler could respond to http://localhost:8080/img/5348024557502961.jpg where the 5348024557502961 value is your guid to look up the image based on the file. Obviously, be aware of security in this context.