Microsphere-assisted microscopy can be incorporated onto conventional light microscopes allowing wide-field and flourescence imaging with enhanced resolution. The refractive index of the background medium in which the microsphere is placed plays an important role in imaging. In this work, we investigated the effect of the background medium containing the microsphere on imaging properties of the microspheres. We used finite-difference timedomain numerical simulation to investigate the photonic nanojet formation in a microlens. We showed that by fine tuning the refractive index of the background medium, the nanojet properties of a microlens can be optimized for applications where sharp focusing of light is needed. Our results provide a guideline for design optimization of novel microparticle-embedded optical devices.