The problem has nothing to do with php environment.
Firstly, you should check if the Varnish HTTP Cache is supported by your hosting provider and if so, you may experience an issues like this on a shared hosting service in a virtualized environment. Second, you should check the path of your moodledata directory.
This two problems are commonly related to each other and together, they prevent images or other data to be displayed.