Spatial control of photoemitted electron beams using a microlens-array transverse-shaping technique