Refactored controller code for reuse - on click gallery buttons, check if id current id and if not rerequest http data