Question: I have a grid of images which is created via angular... Each image is separated by a particular margin and the entire grid is centered in the page via auto margins. When the browser is resized, so too is the number of columns present so that a full amount of columns(none get cut off) are present. There is also a couple fixed links at the top right. All works great. However if the user changes the zoom level below 100% the javascript code still thinks there are one more columns than there is actually room for(and it always seems to be off by no more than a pixel or two.)

I'm thinking I need to be able to access the browser zoom level and make a minor adjustment to hardcoded values(although this should not be necessary on browser level zoom as everything should be downsized) For some reason it does not happen on zooming in (i.e. 110% image unnavailable as I can only upload two links)... You can see at 90% the container for the columns thinks there is a full extra column however the columns do not fit.

[Viewed at 100%](http://i.stack.imgur.com/aTsD8.png)
[Viewed at 90%](http://i.stack.imgur.com/0nsxu.png)

UPDATE: I have found the slider panel(containing element) 
 at 100% a 4 column grid would need a width of 1248px
 at 90% a 4 column grid would need a width of 1249px
 at 75% a 4 column grid would need a width of 1251px
and at 67% a 4 column grid would need a width of 1252px

Still trying to figure out what is creating this pixel size difference at different zoom levels.

UPDATE 2: This issue is present in Firefox and Chrome, but not IE or Edge

Answer: 
You need to modify the following code to copy the image file and only after it has downloaded replace the previous file.

```
$path = realpath(dirname(__FILE__));
for ($i = 0; $i < 59; ++$i) {
    copy('http://<<<IP>>>/livepicture.jpg', $path.'/temp.jpg');
    rename($path.'/temp.jpg', $path.'/livepicture.jpg');
    sleep(1);
}

```
You can try with ajax requet and onload event of image and when your php response good Refresh the page