Did you observe the NameError you described? By reading the flow of this code it seems to me that the rescue clause can only get triggered after the L14 require is executed, because Minimagick errors are apparently raised only starting at L17.
The issue is not errors raised by mini_magick, but when an error is trigger by download_blob_to_tempfile before yielding the block.
In my case, the file couldn’t be found on the remote storage. Therefore the block is never called, mini_magick is never required, and the rescue fails because the exception MiniMagick::Error hasn’t been defined.
The thing is I tried to reproduce inside the corresponding test but require is called separately, and even if I bypass the call, it’s already required by previous tests. So I can submit a PR but I really don’t see how to attach a test or even a script to reproduce the issue.