changed the way gallery processes big images