Fix gallery on front end and edit on admin