This function and the one below are identical except for their name and one line. Please try to find a way to avoid code duplication.

They are also almost identical to `copyImage()` except for one block. Is that block not needed in your methods? Otherwise we'd have 3 almost identical methods.