fixed add and delete bugs, realigned buttons in viewGallery