Fix user gallery form elements
Refactor and add fetching of gallery id