fixed animation delay on gallery resize when screen resizes