Fix image rebase to deal with any protocol

Only http, https and data were being handled.