fixed all bugs and delete functions
fixed show gallery bugs