fix empty gallery on modal open