Replace and resize image