The size of files compressed with JPEG vary depending on the complexity of the image. Trying the control the file sizes the way you describe will result in highly variable perceived image quality.

Consider the following options instead:

* **The good-enough approach.** Use a quality setting that you find acceptable, like 75. Compare the size of the result with the original image, and keep the smaller file. See https://photo.stackexchange.com/q/30243/75526

* **Use a JPEG minimizer**, like JPEGmini or `jpeg-recompress` from [jpeg-archive][1]. They are essentially designed to do what you seem to be trying to do, but with more awareness of JPEG algorithm internals.

* **Generate thumbnails of various sizes**, as [Nathancahill][2] suggests, from a web-developer perspective.

  [1]: https://github.com/danielgtaylor/jpeg-archive/releases
  [2]: https://photo.stackexchange.com/a/104150/75526