Ensure that even very small buffers have enough padding
Fix crash when opening images