.ui-gallery-block {float:left; width:33.333%; text-align:center}

@media all and (min-width:930px) {
    .ui-gallery-block {width:12.5%}
}
@media all and (min-width:610px) and (max-width:929px) {
    .ui-gallery-block {width:16.666%}
}
@media all and (min-width:450px) and (max-width:609px) {
    .ui-gallery-block {width:20%}
}
@media all and (min-width:320px) and (max-width:449px) {
    .ui-gallery-block {width:33.333%}
}

.ui-gallery-link {display:block; margin:5px; border: 1px solid #aaa; cursor:pointer}
.ui-gallery-link > img {display:block; width:100%; height:auto; border-radius:0.55em}
.ui-gallery-prev > span, .ui-gallery-next > span {height:15px}
.ui-gallery-prev, .ui-gallery-next {position:absolute; top:45%; z-index:999}
.ui-gallery-prev {left:-25px;}
.ui-gallery-next {right:-25px;}

#ui-gallery-page,
#ui-gallery-page > .ui-content {margin:0px auto; padding:0px; background-color:#000; height:100%; width:100%; overflow:hidden; position:relative}
#ui-gallery-page > .ui-content div {position:absolute; top:0px; height:100%; width:100%; background-position:center; background-size:contain; background-repeat:no-repeat}
#ui-gallery-page > .ui-header .ui-icon {margin-top:2px; height:15px;}
#ui-gallery-page > .ui-footer  {text-align:center; padding:10px; height:2%;}

.ui-collapsible-content {overflow:hidden}