fixed the bug where the pictures disappear after ajax button is clicked