JS helper to keep an image focus in shot