Fixing crash when quickly scrolling through galleries