Added gallery support.
Fixed some issues.