changed the method setWidth to get the right height for the gallery, now that is set as relative
created the  mode