fixing image flickering