add functionality for buttons
fix for different image dimension